Solved

Flash global variable

Posted on 2011-03-05
4
266 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:umaxim
  • 2
4 Comments
 
LVL 37

Expert Comment

by:CyanBlue
ID: 35046834
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
0
 
LVL 17

Expert Comment

by:deepanjandas
ID: 35051415
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
0
 
LVL 1

Author Comment

by:umaxim
ID: 35061978
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.
0
 
LVL 17

Accepted Solution

by:
deepanjandas earned 500 total points
ID: 35063778
SO it depends:
You may use root.variableName
or parent.variableName. But REMEMBER to declare the variableName is proper place.

Share your fla to suggest specifically.

Warm Regards
Deepanjan Das
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now