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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a variable and pass thru

Status
Not open for further replies.

2cxc

Programmer
Aug 29, 2003
245
CA
Using flash 5, I would like to create a new variable from on press of each button (6 buttons) in scene1, also from button state going to the end of scene1 frames, and on the last frame determine the variable and goto one of the other 6 scenes based on the variable, variable aa = 2 goes to scene2, aa =3 scene3, aa=4 scene4.....etc

This doesn't seem to wnat to work.?.. this is what i have:

button1 in scene1:

on (press) {
aa = "2";
gotoAndPlay(20);
}


last frame in scene1:

stop();
if (aa=2) {
gotoAndPlay("Scene 2", 1);
} else if (aa=3){
gotoAndPlay("Scene 3", 1);
} else if (aa=4){
gotoAndPlay("Scene 4", 1);
} else if (aa=5){
gotoAndPlay("Scene 5", 1);
} else if (aa=6){
gotoAndPlay("Scene 6", 1);
} else if (aa=7){
gotoAndPlay("Scene 7", 1);
}
 
Ok i've done a change but it still isn't working,
is in setting the variable in the buttons:

on (press) {
var aa = "";
set ("aa", 2);
gotoAndPlay(20);
}

 
well i learnt the trace thingy and the variable aa is defined properly in the last frame of scene1, so I guess its how i'm trying to define the variable value for scene change...hmmm
 
DOH!!!


if (aa==2)

NOT

if (aa=2)

Task Completed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top