/ Published in: ActionScript 3

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// you might want to call a function but you have the function name as a string, this is how to do it // Create new :Function var and give it the string using this[] for(i=0; i<4; i++) { var funcName:Function = this["func"+i]; funcName(param1, param2); } function func0(p1, p2) { } function func1(p1, p2) { } function func2(p1, p2) { } function func3(p1, p2) { }
Comments
