I’m a brand new AS kid here, haha, like, started last week, but I am working on a science fair project on random stuff, blah blah, heres the meat of my problem.
I have three movies that need to be randomly selected and then played.
These three movies must be played after a button click. Here’s how i set up the script for setting the randomness for the variables. (i dont know how you guys did that nifty code tag thingy, so I’ll just paste it into here)
//set beaker variable
Beaker = random (3) + 1;
//Beaker Movie script
if (Beaker == 1) {
beakerGo = "revealBlue_mc" ;
beakerColor = "BlueMovie" ;
}
if (Beaker == 2) {
beakerGo = "revealRed_mc" ;
beakerColor = "RedMovie" ;
}
if (Beaker == 3) {
beakerGo = "revealGreen_mc" ;
beakerColor = "GreenMovie" ;
}
//End Beaker Movie Script
ok, so that sets even more variables according to what the random number that Beaker variable comes out with. An explanation of the variables.
Beaker - just my random number holder
beakerGo - thats the actual instance label of my movie clip on the stage
beakerColor - thats the label i gave inside the movie clips mentioned above.
Now I head on over to my buttons that I want to play, and I’ve done this code here, inside the buton instance.
Here’s an explanation of what I’m wanting my button to do. First I want the button to make itself, and the things behind it to dissappear by going to frame labels that basically have nothing in them and stop the appropriate movie clips there. Then I want it to bring in the randomly chosen of 3 movie clips. Heres the code that I’m butchering, haha.
on (release) {
_root.CPD_mc.gotoAndPlay ("CPDVanish");
_root.hide_mc.gotoAndPlay("HideVanish");
_root.beakerGo.gotoAndPlay ("beakerColor");
}
yea, i’ve got a lotta unecessarry stuff in there, but i am not really sure how to do it correctly, so I was just being absolutely sure and using root paths. Can anyone help me out here and tell me how to take the variable and inject it into a path so taht it will play a movie clip and a label inside that movie clip (obviously from my bad code there, 2 variables are used, but if you know of a better way, by all means speak! ).
Thanks so much in advance!