I’m trying to set global var at the main movie timeline in first frame. Than I need to reach and to change this var inside of the sub-mc every time when it plays in loop with main mc.
In details: there is a sub-sub-mc which gets visibility from sub-mc depending on this global var, and also changes this global var. So I need to reach it and change every loop of mc.
Would be very glad to get any suggestions. I tryed many ways - nothing has worked.
At least concearning the flash 5 version(don´t now if it changed in FMX):
Global variables are variables that can be set or retrieved at any point anywere. What you are sugesting is just a variable located a the root, then, a local variable located at the root (or main timeline) not global.
Global variables don´t exist on flash they are simulated by this code:
Object.prototype.yourGlobalVariable = value;
But it is easier if you refer to a variable to the respective location .
Example: You want to set the value of the pamelaAndersonIsHot variable located inside the movieclip foxy at the main timeline (_root) to true: