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!

Global Variable Returning Undefined

Status
Not open for further replies.

TommyIndigo

Programmer
Sep 14, 2000
67
US
Using MX 2004 Pro -

In my main movie, I have a global variable that I am setting using:

_global.MyVar = "test";

The main movie then dynamically loads other .swfs on higher levels. One of these loads another .swf on yet a higher level.

I am trying to access the value of this variable from this highest level movie, but it is coming as undefined. I believe I have done this in the past....any ideas what is wrong??

FYI, I already tried the following:
1. Defining the variable with and without 'var'
2. Accessing the variable with and without the '_global.' prefix
3. Trying the same using '_root.' insteadh of '_global'
4. Quadruple-checked spelling and case

Thanks!
 
Are you using GET or POST when you load the movie you are having trouble with?

Wow JT that almost looked like you knew what you were doing!
 
Neither. The movies are dynamically loaded using loadMovieNum().

Thanks,
TOM
 
Did you try an onEnterFrame function on the highest level movie's first frame?
From where are you trying to access the variable? From the highest level movie itself?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top