I wanna to propose the following patch.
It will allow me to add listeners to theMonkey. Like this:
FlexMonkey.theMonkey.addEventListener(FlexEvent.CREATION_COMPLETE, startUp);
I need that to run integration tests using flex-mojos.
Index: src/com/gorillalogic/aqadaptor/AQAdapter.as
===================================================================
--- src/com/gorillalogic/aqadaptor/AQAdapter.as (revision 78)
+++ src/com/gorillalogic/aqadaptor/AQAdapter.as (working copy)
@@ -254,7 +254,7 @@
var byteArray:ByteArray = new FlexMonkeyEnv() as ByteArray;
var env:String = new String(byteArray.readUTFBytes(byteArray.length));
setTestingEnvironment(env);
- PopUpManager.createPopUp(DisplayObject(Application.application),
FlexMonkey);
+ PopUpManager.addPopUp(FlexMonkey.theMonkey,
DisplayObject(Application.application));
}
}
Index: src/com/gorillalogic/flexmonkey/FlexMonkey.mxml
===================================================================
--- src/com/gorillalogic/flexmonkey/FlexMonkey.mxml (revision 78)
+++ src/com/gorillalogic/flexmonkey/FlexMonkey.mxml (working copy)
@@ -50,12 +50,12 @@
/**
* Currently running FlexMonkey instance
*/
- public static var theMonkey:FlexMonkey;
+ public static const theMonkey:FlexMonkey = new FlexMonkey();
private static var autoStart:Boolean = false;
private function create():void {
- theMonkey = this;
+// theMonkey = this;
if (autoStart) {
// For some inexplicable reason, setting selectedIndex is having no
effect :(
tabs.selectedIndex = 2;