Created
April 7, 2010 20:03
-
-
Save trxcllnt/359366 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override protected function initializeApplication():void | |
{ | |
// Try to initialize mixins to the ReflexApplicationLoader | |
// (a well behaved mixin relies on a MovieClip), | |
// but if anything goes wrong, don't allow mixins to muck | |
// up our initialization. | |
var mixins:Array = info()["mixins"]; | |
if(mixins && mixins.length > 0) | |
{ | |
while(mixins.length > 0) | |
{ | |
try{ | |
getDefinitionByName(mixins.pop())["init"](this); | |
} | |
catch(e:Error){/* Fall through */} | |
} | |
} | |
// Cast with 'as' because create() can possibly return 'null', | |
// and casting 'null' to a DisplayObject will throw an error | |
var app:DisplayObject = create() as DisplayObject; | |
// If there's no app, this is probably an app made in Flash Pro, | |
// in which case moving to the second frame is sufficient action | |
// on our part. | |
if(!app) | |
{ | |
return; | |
} | |
//The Application should listen for its own added_to_stage | |
//event and initialize itself from that. | |
addChild(app); | |
super.initializeApplication(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment