/ Published in: ActionScript 3

Just add a method like this in a Class that needs to call methods dynamically, without a prior knowledge of whether they exist or not.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function methodExists(methodName:String) : Boolean { var exists:Boolean; try { exists = this[methodName] != null; } catch (e:Error) { exists = false; } return exists; }
Comments
