Posted By

forchid on 08/10/09


Tagged

class as3 Definition


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

volvis
spastic


Check if Class Definiton exists


 / Published in: ActionScript 3
 

  1. var instance:Sprite;
  2.  
  3. if ( ApplicationDomain.currentDomain.hasDefinition("MyClassName") )
  4. {
  5. var MyClass:Class = getDefinitionByName( "MyClassName" ) as Class;
  6. instance = new MyClass( params ) as Sprite;
  7. }else {
  8. instance = new Sprite( params );
  9. }

Report this snippet  

You need to login to post a comment.