/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var className:String = 'com.firstrowria.SampleClass'; var classReference:Class = Class(getDefinitionByName(className)); var classInstance:Object = new classReference(); var functionName = 'sampleFunction'; var functionName2 = 'sampleFunctionWithParameter'; classInstance[event.functionName](); classInstance[event.functionName2]('this is my string parameter');
URL: http://www.firstrowria.com/2008/06/as3-reflection-in-actionscript/