Link to home
Start Free TrialLog in
Avatar of umaxim
umaximFlag for United States of America

asked on

Flash global variable

Hi i want to use a global variable in action script 3. How i can do it. Can any one help me. I need some example because i just begin to study it.
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Please take a look at these blog posts for the solution...  It's not really recommended to use a global variable in AS3 but nobody is stopping you for using it...
   http://www.uza.lt/codex/as3-global-object/
   http://mtrinitaria.com/mykhel/global-variables-as3/

CyanBlue
If you are using timeline script use root.variableName to access it.

Otherwise the suggestion which CyanBlue provided of singleton class is a good way to do so.

Warm Regards
Deepanjan Das
Avatar of umaxim

ASKER

I use a script and make a look when for example i click contact it begin loop again and in animation clip i put code take number from variable and stop on number frame. This why i need to get root variable on 1 level down.
ASKER CERTIFIED SOLUTION
Avatar of deepanjandas
deepanjandas
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial