Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
10-09-2011, 01:19 PM #1
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 65 Times in 64 Posts
Accessing "global" variable from inside a class
I have 2 classes - level and objects.
On my stage I have several instances of a movieClip linked to a custom class "objects" on the stage (each instance has a unique name). The constructor for the objects class adds a mouse click event listener that triggers an objects method.
On my actions layer I create an instance of level. The problem is the objects method needs access to properties of the level instance and I can't seem to access it - level doesn't exist within the objects method.
So how can I set things up so that any movieClips of type "objects" on the stage have access to variables created via actionscript on the timeline?
(also please be gentle - I only started learning actionscript yesterday)