Posted By

Ether on 08/26/09


Tagged

Reflection as3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

macKaminski
quan


Reflection in ActionScript 3


 / Published in: ActionScript 3
 

URL: http://www.firstrowria.com/2008/06/as3-reflection-in-actionscript/

  1. var className:String = 'com.firstrowria.SampleClass';
  2.  
  3. var classReference:Class = Class(getDefinitionByName(className));
  4.  
  5.  
  6. var classInstance:Object = new classReference();
  7.  
  8.  
  9. var functionName = 'sampleFunction';
  10. var functionName2 = 'sampleFunctionWithParameter';
  11.  
  12. classInstance[event.functionName]();
  13. classInstance[event.functionName2]('this is my string parameter');

Report this snippet  

You need to login to post a comment.