I have a project in ActionScript 3, Flash Professional CS5.5, and AIR 3.
I have several custom classes that I need to access. Currently, I am successfully accessing via the traditional method:
import trailcrest.core.core;
var Core:core = new core();
However, I came to a realization in my code…this creates a COPY of the class, and doesn’t give access to the original. This, of course is a problem – I need one symbol’s scripts to modify a variable in the class, and another symbol’s scripts access that changed variable. Obviously, right now, that is not occurring.
How do I do what I am describing? Should I somehow create a “public var” for the class (though I need instructions on how to do that…I can’t use “public var” within stages or symbols)? Is there some way to directly access the class?
Help! And thanks in advance.
You can consider using a static class variable, something like:
Then in your grandchild code:
Edit
Of course adding the singleton type of method as was suggested by others would make it even cleaner, I will up-vote their answers as well.