Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: An array for random movies |
From: | Nathan Dicken |
Date: | Wed, 28 Jun 2000 17:32:38 +0100 |
Troy,
Here's an method that you could use. Might at first seem a little
complicated but it works great and is reusable. Since 10 is a two-digit
number, form a list (string) like this to hold all possible values - all
with matching numbers of digits:
Set Variable: "digits" = "2"
Set Variable: "list" = "01020304050607080910"
Next, find the length of this list (which is 20 to start out) and divide it
by the number of digits you have. This will be the number that you use in
the random function as so:
Set Variable: "rNum" = random((length(list)/digits))+1
Esentially, your random index number "rNum" coordinates with how many
numbers you have in the list at that time. You'd find the number for the
random MC by finding the number in the list and converting it to an integer...
Set Variable: "rValue" =
int(subString(list,((rNum*digits)-(digits-1)),digits))
For example, the length of the list to start is 20 and the number of max
digits is 2 (as in 10). In the rNum expression, the value inside the
random function would be 10, giving you random(10)+1. Let's say this
provides you with a rNum value of 2. Since each value in the "list"
variable is two digits, you'd want the subString function to start on
character #3 and go two digits (or the value of digits), therefore giving
you a value of "02". Converting this to an integer gives you your random
MC value (rValue) of 2. The next steps would be to reform your list with
the chunk of the "list" variable that is before the "02" and the chunk
afterwards". In this case, your new list variable would be
"010304050607080910". Running the above rNum and rValue statements again
and reforming the list will provide you with random, but unique numbers
each time until the list variable is empty.
Let me know if you have any questions regarding this and I hope this helps.
Nathan
-------------------------
Nathan Dicken
Boxerjam Inc.
100 Second St. NW
Charlottesville, VA 22902
nathandboxerjam [dot] com
www.boxerjam.com
>I asked this question a LONG time ago and several people answered me,
>but I need to ask again...
>
>I have ten MCs that are randomly brought up by a button. I would like to
>set up a script that, while still random, cycles through the MCs until
>it has gone through all of them.
>
>The set-up is:
>
>MCa (inst: Head)
> MC1 (inst: Haircut)
> Target1-10
>
>I'm still struggling with the whole concept of arrays, and I know
>they'll do the job, but math classes (and calculus) are so far in the
>past and so unused, that I'm mathematically crippled.
>
>All this is for www.funkyafro.com, please check it out.
>
>Thanks in advance,
>
>Troy Swain
>troyswainfunkyafro [dot] com
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: An array for random movies, Troy Swain
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]