Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Created December 6, 2013 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjattrill/7818121 to your computer and use it in GitHub Desktop.
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
public function checkFunc() : void {
Alert.show("inside function");
}
public var myfunc:String = "checkFunc";
public var newFunc:Function = this[myfunc];
newFunc(); // This will invoke checkFunc
@rjattrill
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment