PDA

View Full Version : Variable problem


Ryan_
04-03-2005, 12:32 AM
Hi!! First i'd like to say that this comunity is really cool... :)
I'm starting to learn ActionScript and i have a question on global variables, this is the thing:
i create a movie clip and on frame 1 of that movie clip i write:
_global.country = "England";
then on the main timeline on frame 1 i write this:
trace(country);
and this returns Undefined!!!
is it allright? it should say England instead...
This question may seem very lame but i'm just starting!... please help me.

Ryan.

Laguana
04-03-2005, 12:54 AM
That's probably because the timeline runs before the movieclip runs. So you're asking for the variable before it's been set.

Ryan_
04-03-2005, 01:03 AM
Hey, thanks! I think you're right.
Although my question was so simple, you took the job to answer it...that's very nice Laguana.

Ryan.