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

passing variable through 2 swf ????

Status
Not open for further replies.

Doum

Programmer
Dec 17, 2001
6
CA
i really nedd help here.
i have 2 swf. in the first i determine a variable and then open the second swf with a loadmovie action. now the second swf need to know the variable to go to the right frame.

it would be so simple if i knew how to open a swf from another swf at a specific frame or scene.
do you know one way or an other?
please help me!!!
thanks
:)
doum
 
If your design permits you to load the second .swf on another level on top of the first main movie, then you can easily control it and send it to any frame you want it to go to.
If you have to go with two seperate movies, you'll then probably have to resort to javascript and Flash methods.

Read up on this:

Check the GotoFrame method!

Regards,
wink4.gif
ldnewbie
 
thanks
the thing is the second swf load on level 1 (on top on the other one)
in the first swf there's 4 buttons
on each button there is a variable
and it open the second swf
the second swf must go to a different frame (or scene) depending on the variable of the first swf.

i can't belive i can't find this information on macromedia. i'm sure i'm not the first one thinking about this... :)
thanx
 
In that case, it should be really as simple as sending the loaded movie to the right frame on each different button press. You don't even really need a variable.
Suppose your second movie is loaded and stopped on a blank frame 1, then all you have to do is to target a particular frame from your buttons, with something like this:

on(press){
_level1.gotoAndPlay(x); // Could be gotoAndStop(x);
}

...x being the targeted frame. Or if you label your frames, you could use:

on(press){
_level1.gotoAndPlay("label");
}

You could even condition this according to a variable:

on(press){
if (variable == this or that){
_level1.gotoAndPlay(10);
} else {
_level1.gotoAndPlay("label");
}
}

Regards,
wink4.gif
ldnewbie
 
thank you sooooooooooooooo much!!!!!
doum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top