Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Arrays to control random MCs
From: Branden Hall
Date: Wed, 1 Mar 2000 02:25:14 GMT

You don't actually have to create a whole separate array... you can just use
the current array of names of MCs to tell target and shuffle them.
Say you have a set of variables, mc1, mc2, mc3, etc.. that are equal to the
names of your MCs... (in the case of hair styles) mc1="/mullet", mc2="/perm"
, mc3="/skater", etc

Then you would use the following code to shuffle up the list.

Set Variable: numMCs = 5
Set Variable: numShuffles = 10
Set Variable: count=1
Loop While (count <= numShuffles)
Set Variable: shuffle1 = (random(numMCs)+1)
Set Variable: shuffle2= (random(numMCs)+1)
Set Variable: temp = eval("mc"&shuffle1)
Set Variable: "mc"&shuffle1 = eval("mc"&shuffle2)
Set Variable: "mc"&shuffle2 = temp
Set Variable: count = count+1
End Loop

-= Branden J. Hall
-= Multimedia Developer/Instructor
-= Fig Leaf Software

----- Original Message -----
From: Laura Mollett <lmollettatmindspring [dot] com>
To: <flasheratchinwag [dot] com>
Sent: Tuesday, February 29, 2000 9:28 PM
Subject: Re: FLASH: Arrays to control random MCs


> I would like write an action script that cycles through the MCs. I want
the
> movie to randomly play one of each of the seven MCs until they've all
played
> and then to start over again. From what I'm reading about arrays, it
sounds
> like they will do an efficient job. However, I don't really understand how
> arrays work.
>
> I know I could write a Set Variable, but it seems like an ugly solution.
>
> (The MCs are six animated heads and seven animated haircuts. As the site
> stands now, the viewer can get the same head or haircut over and over
> again.)

I think this is how you would do it:
Number all the movie clips: 1-7 (name them with an instance name, like clip1
- clip7). Then have a variable ClipCounter that you set to 0,
Set Variable: "ClipCounter" = 0
Loop While (ClipCounter < 7)
Set Variable: "ClipCounter" = ClipCounter +1
Set Variable: "Clip" & ClipCounter = False
End Loop
(You'd put that on your main timeline)

When you click the button have it do this:
Loop While (Done = False)
Set Variable: "CurrentClip" = Random(7) + 1
If (Eval("Clip" & CurrentClip) = False)
Load <movieclipname> [or tell target play or whatever you want]
Set Variable: "Done" = True
Else
Set Variable: "Done" = False
End If
End Loop

This will, I think, play a random movie clip when you click the button, but
never the same one twice. You might hafta play with it some to get it to
work. I don't know how you'd do it without using set variable... why's it an
ugly solution?

Laura

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World's Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com




flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World�s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: Arrays to control random MCs, Laura Mollett

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]