Hello forum,
I’m starting out in ActionScript for Flash MX, got done with a few chapters in ActionScript for Flash MX by Colin Moock and I have a few frustrating problems.
#1)
I created a square, defined as a movie clip symbol (named square), placed it on the main timeline and made an instance of it called mySquare.
Now, I want to create a global variable that is directly accessible to all the scripts in a movie (any timeline). And I want the global variable to be declared and initialized in the movie clip symbol (named square).
So I put the following code on frame 1 of the ‘square’ movie clip timeline:
_global.day = “Monday”; //Moock’s book - page 50.
Then I placed the following code on frame 1 of the main movie:
trace(day);
According to Moock’s book, it says that because the ‘day’ variable is global, Flash MX can find it from the main timeline, even though it was created in the ‘square’ movie clip.
When I test the movie, the output window displays:
undefined
Why is it still displaying ‘undefined’.
Your help and assistance is GREATLY appreciated!!
Sincerely,
byron m.
cadmiumgreen