Variables

I know in Visual Basic there is are two types of variables… local and global. Is there such a thing in Flash MX? For instance, if I create a varible such as “finish line = 20” for a movie clip, is that variable still true if I use it in a different movie clip? Or do I have to make it a varibale for the whole entire animation?
If you cant understand, I will try to explain further.
Thanks

I can tell you, in Flash 5.0, that there are only local variables, but I do remember speak from the masters (Supra and Pom) about global variables and how to create them in MX, and how to artificialy imitate them in 5.0. I’d suggest doing a ‘search’ in the MX and Action script forum here using the keywords ‘global’ and ‘variables’. I’ll bet you’ll find the thread they were discussing it in.

Yes there is indeed global and local variables
To properly use them you need to specify them as such:

finishLine = 20 //would be local to the movie clip it is in
_global.finishLine = 30 //would become global regardless of movie clip it is in.

Depending on the movie clip you are in you can refrence any variable using the specified path such as:

_root.movieClipA.finishLine = 20

or

_global.finishTime = _root.movieClipA.finishLine

Just make sure you define the path to the variable and all will work superb!!!

I should also specify that you can use the same named variable in diffrent movie clips!

Hope this helps!

[SIZE=24]RAHHHHH!!![/SIZE] Does anybody read the AS tricks?? :frowning:

HOLY COW!!!
It was there the whole time… :wink:
Thanks for the link…