Random()
- Started
- Last post
- 8 Responses
- Epictive0
Could you be a but more specific? Like are you wanting to play a group of movieclips in a random order, play a single clip randomly out of a group, position a clip randomly on the stage. I be glad to help if I knew what your goal was.
- MichaelFelt0
The aim is to get a number of Movie Clips say 10+ to come on in a random order.
each movie clip will have a short animation/time delay and then will play the next random movie clip.
plus I want it to never end plus not to repeat the same one twice.
Thanks for the help bro!
- unfittoprint0
myMovies = new Array("myMovie1.swf" , "myMovie2.swf", "myMovie2.swf", "myMovie3.swf")
myMC.loadMovie(myMov ies[Math.floor(Math. random()*myMovies.length)])
- Epictive0
What he said.
- armed_rob0
this one:
mc.gotoAndPlay("start"+(random(3...
is a random action for a movieclip ("mc") with 3 frames ("start1", "start2" and "start3")
...but its not for different movieclips!
- MichaelFelt0
I think armed rob has hit the nail on the head, I want it to randomise from a movie clip inside the fla, not an external swf, cos im planning on making this as a screensaver you see.
ive justed tried the actionscript but I cant get it working as im no tha good at flash, could some help us with this code??
thanks in advanced!
- armed_rob0
create a movieclip call it mc in the "Instance Name" field.
Db. click to edit the movieclip, do 3 keyframes - or how many you like - with stop actions. Call them "start1", "start2" and "start3" in the "Frame Label" field and put your shit in on the different keyframes (maybe as movieclips)
paste the code into a frame in the main scene:
mc.gotoAndPlay("star t"+(random(3)+1));
if you make more than 3 keyframes it just looks like this:
mc.gotoAndPlay("star t"+(random(999999)+1));
- MichaelFelt0
Yup I got it working thanks peeps!