In one of senocular’s AS3 tips (http://www.kirupa.com/forum/newthread.php?do=newthread&f=9) he mentioned using a TopLevel class which would then be extending by the document class to create “global” root access. Instead of making my document class extend TopLevel, could I assign stage and root properties directly to the document class, from inside the constructor? For example:
package {
import flash.display.MovieClip;
public class MyDocumentClass extends MovieClip {
public static var stage:Stage;
public static var root:DisplayObject;
public function MyDocumentClass() {
MyDocumentClass.stage = this.stage;
MyDocumentClass.root = this;
}
}
}
EDIT: Or maybe not define those two properties at all, just reference MyDocumentClass.root from whichever class I need root access too?
Cheers,
ghjr