There must be a proper area and proper packaging.
Declare a static variable to handle your access to the main document class
private static var _instance:Main; public static function get instance():Main { return _instance; } public function Main() {
Declare some getters and setters in the main document class
private var _foo:int = 0; public function get foo():int{ return _foo; } public function set foo(value:int):void { _foo= value; }
And then in any class you need, you can change something as follows:
public class O { public function O() { Main.instance.set(Main.instance.get() + 1); } }
source share