Jumping to a random label, scene, frame

1. define a label in every frame you want to jump randomly 2. use the following script: // define a array with all your previously defined labels labelarray=["scene1","scene2","scene3","scene4"]; // calculate a random index for this array randomidx = random(labelarray.length); // jump to the label at the random index gotoAndPlay(labelarray[randomidx]);
Cyberrosie Date: 21/06/2001

Hi there!! Could you please be so kind to help me out here!! I\'m just starting Flash... I made a MC containing 4 button, each to go to another scene. The first button works, i did: on (release) { tellTarget (\"_level0\") { gotoAndPlay (\"scene3\", 1); } } But when I do the same for the other buttons, but ofcourse then gotoandplay scene4 etc, it still goesto scene 3. Frankly, I don\'t really understand what this _level-stuff is all about...what do I do wrong?? thankyou, thankyou, thankyou for you time!!!! greetings
albert Date: 07/05/2002
i have tried to find a site who tells you how to link from on flash file to a cretain frame in a diffrent flash file but i cant. can you tell me how to do that or if it is even possible? i know how to link to the other file but i want it to go to a certain frame in that file!!! please help. thankyou!!!
chris Date: 14/06/2002
you've grouped the buttons together thus they all go to same frame...make sure u do them individually. ta
Kevin Date: 26/01/2004
Hi Guys, Yes, it is possible to send your Flash Movie to a different scene, and a different Frame within that scene. Here is the example code you would apply to the button, or play-head frame in the timeline: on (release, keyPress "<Left>") { {gotoAndPlay ("scene_1", 3); stopAllSounds(); } } The "scene_1" would be re-named to your scene's name that you want to send the movie to, and the number after the specified scene would be the frame within that scene you want it to go to and start playing at. Remeber, if you want the movie to stop at that frame, to put a "stop,;" action on the FRAME. I'm not sure if you have to use dot syntax to come up out of a movie or not to make this work, but I don't think so... Happy Flashing!!!
Kevin Date: 26/01/2004
Hi, sorry - also the "<left>" is the instance name applied to the button under the properties roll out. "Left" just happens to be my buttons name, your button instance name will most likely be different. Kev
Dave Date: 26/02/2004
hmmmm, your only 3 years late Kev LOL
dtalnk Date: 14/04/2004
haha This is great! OK why doesn't my interstellar ship's fuel cells function at temperatures beyond 300K? Don't tell me now, I can wait!
stellartravel Date: 08/08/2007
They don't work above 300*K because you've designed them to run under cold conditions being cold in space, in the shade. Check your safety cut out settings. It may be tripping due to the change in resistance especially if you've got them computer controlled...
Add comment