PDA

View Full Version : AS to pick between playing two scenes


mnik
05-14-2002, 03:28 PM
This should be fairly easy for most folks.
I have a Flash splash movie for a site. Currently there is a preloader Scene1 checks to see if the last frame of Scene 2 (the "real" Splash Movie ) is loaded yet, if not it loops back a few frames and keeps checking. Works great.
EXCEPT now I want Flash to randomly pick between two different movies - and check to see if the one it picked is loaded yet. (Just like when it did for the one movie)

I know that MathRandom is part of the solution but looks a little complicated for me now.
Help!

Thanks much!

mnik
05-14-2002, 03:53 PM
I think I've come up with the architectural part of the solution:
I created a new scene as the first scene. It's an empty MC with a script that will choose from an array. Based on that choice (made by Flash) it should take you to one of two preloader scenes that will then play a splash movie.
All I need now is to figure out the AS script for that first "randomizer" scene.

CyanBlue
05-16-2002, 12:18 AM
Hi...

To get the random sequence, you will have to generate a random number and based on that number you will be able to go to either way....


randNum = Math.floor(Math.random() * 100);
if ((randNum % 2) == 0)
// play the first splash
if ((randNum % 2) == 1)
// play the second splash
Would this help you???

Jason