PDA

View Full Version : Randomly play movie clips


Duders
08-17-2005, 06:21 PM
I have a several movie clips in my animation and I need to know how to get them to play randomly like the background stuff in this:

http://www.weebls-stuff.com/toons/hos/

Please help! :confused:

flashead
08-17-2005, 06:29 PM
on Frame 1 of your animation put://pick a random number between 0 and 99.
//the larger the number the less often it plays
num = random(100);
on Frame 2 of your animation put://if 'num' doesn't equal 1, go back to the frame before and randomly pick another number.
if (num != 1) gotoAndPlay(_currentframe - 1);
on Frame 3 start your animation... Here's an FLA too...

Duders
08-19-2005, 01:47 PM
Isn't that just a loop?
pick number
if number isnt 1 go back

It doesnt say if number is 1 to do anything

flashead
08-19-2005, 06:40 PM
well if num = 1 it skips the code that makes it go back therefor making your animation play...
did you look at the file? The animation in the file plays randomly just like you asked.

Duders
08-20-2005, 08:17 AM
Its ok i it out now neway :S
Im a bit of a newb at action script as u can c?
could you plz tell me How you make all the loops in your animation stop at the end of your animation?

Duders
08-20-2005, 08:17 AM
btw the fla didnt work for sum reason, the swf did tho

thebob
08-21-2005, 12:23 AM
Hey man, writing in a bastardised version of english when asking for help/explaining something is not very handy!

Its ok i it out now neway :S

I looked in here because i would like to know too :)