Sunday, April 4, 2010

_global VS. _root

Generally, the use of _global is recommended.

_root
When you load a MovieClip into the root of your movie, all previous _root variables are lost;
_root variables can be called and set by using the _root. prefix;

_global
Aren't lost when you load a new MovieClip;
Applies to all movies within the player;
Can be called from anywhere by either using or not using the _global. prefix;
Local variables (local means on the timeline you are working on) with the same name as a global variable, have priority.

No comments:

Post a Comment