Hi, I’m having trouble understanding AS3 Classes. I would like to store a class into a variable. For example:
Main.as can (import Assets.*;) and access (public static vars) by referencing them (Assets.Assets.somestaticvariable). All is good.
Main.as can also declare (private static var AA:Class=Assets.Assets;) in its class section and access the same variable above via (AA.somestaticvariable). All still good.
somestaticvariable can be any singleton (int, Number, Sprite, …). However, it cannot be an (Array, Vector, or function). WHY?
Assets.Assets.imgArr.push(…); works, all other .as files referencing this global array are in sync.
AA.imgArr.push(…); blows chunks.
Calling a static function:
AA.somestaticfunction(…); wont even compile.
I’ve also tried to declare AA: (private static var AA:Class=ApplicationDomain.currentDomain.getDefinition(“Assets.Assets”) as Class;) with the appropriate import, and same results as other declaration.
Why are the singletons working, but the array and functions failing? all are declared (public static var).