diff --git a/starling/src/starling/core/Starling.as b/starling/src/starling/core/Starling.as index fb9c015f0..e01c88b9b 100644 --- a/starling/src/starling/core/Starling.as +++ b/starling/src/starling/core/Starling.as @@ -213,6 +213,7 @@ package starling.core private static var sCurrent:Starling; private static var sHandleLostContext:Boolean; private static var sContextData:Dictionary = new Dictionary(true); + private static var sAll:Vector. = new []; // construction @@ -274,6 +275,8 @@ package starling.core // for context data, we actually reference by stage3D, since it survives a context loss sContextData[stage3D] = new Dictionary(); sContextData[stage3D][PROGRAM_DATA_NAME] = new Dictionary(); + + sAll.push(this); // all other modes are problematic in Starling, so we force those here stage.scaleMode = StageScaleMode.NO_SCALE; @@ -344,6 +347,12 @@ package starling.core if (disposeContext3D.length == 1) disposeContext3D(false); else disposeContext3D(); } + + var index:int = sAll.indexOf(this); + if(index != -1) + { + sAll.splice(index, 1); + } } // functions @@ -1058,5 +1067,11 @@ package starling.core else sHandleLostContext = value; } + + /** All Starling instances.

CAUTION: not a copy, but the actual object! Do not modify!

*/ + public static function get all():Vector. + { + return sAll; + } } }