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!

Targeting a Variable (FLASH)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How do i target a variable that is on another level to the one that I am currently on?
I load a movie onto level1, then I want to use a variable on level0 in a script in the movie on level1. I have tried _leve0.checkSub == "xyz" but that does not work.

If i do a trace on the variable from level1, i get a message saying undefined. Please help.

Chris
 
Set your variable in the main movie as:

_level0.my_variable = "Hello World!";

Or...

_level0.my_variable = 10;

To trace it in _level1, add the following:

trace(_level0.my_variable);

Or use it in an if statement:

if (_level0.my_variable == "Hello World!") {
// Do some stuff... ;
} else {
// Do some other stuff... ;
}

Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top