In ActionScript 3, I read that the root variable refers to an instance of a document class.
Inside the document class constructor, a trace(this == root) returns true . Later in the constructor, the constructor of another class is called. This constructor, however, claims that root is null . Finally, tracking from an event listener gives me the result that root is [object Stage] .
My goal is to have one instance of a document class (in MainGame.as ) and be able to refer to it as (root as MainGame) in my ActionScript program. How can i do this?
If that matters, all of my code is in the default package.
Thanks!
source share