Created
December 6, 2013 03:31
-
-
Save rjattrill/7818121 to your computer and use it in GitHub Desktop.
Call a method or access a property dynamically in ActionScript given a string matching the method name or property
This file contains 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
public function checkFunc() : void { | |
Alert.show("inside function"); | |
} | |
public var myfunc:String = "checkFunc"; | |
public var newFunc:Function = this[myfunc]; | |
newFunc(); // This will invoke checkFunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found at http://stackoverflow.com/questions/6216155/dynamically-call-a-function