/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var instance:Sprite; if ( ApplicationDomain.currentDomain.hasDefinition("MyClassName") ) { var MyClass:Class = getDefinitionByName( "MyClassName" ) as Class; instance = new MyClass( params ) as Sprite; }else { instance = new Sprite( params ); }