Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to play random scene in a mc and on press...

Status
Not open for further replies.

paola13

Technical User
Oct 22, 2001
36
IT
I have a mc with 5 keyframes with labels:
uno
due
tre
quattro
cinque
I have 5 istance of the same mc on stage.
Inside mc in the layer actions i put:

inizio = new Array("uno", "due", "tre");
tocco = new Array("quattro", "cinque");
gotoAndPlay(inizio[random(inizio.length)]);
if (imput == 1) {
gotoAndPlay(tocco[random(tocco.length)]);
}else{
gotoAndPlay(inizio[random(inizio.length)]);
}

At the end of the frame "tre" i have written

gotoAndPlay(1);

In this way the other scenes don't play.
Inizio is the array of labels frame which is playing. When i press a button, i would like the array "tocco" plays, with its scenes ("quattro", "cinque"), but if i'm in the middle of "due", it has to finish this actions and then jump to "quattro" or "cinque".

To make this possible in the button in the main stage:
on (release) {
imput = "1";
}

So many words to say at the end... it won't work. Where i wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top