I'm trying to create functions dynamically, but I'm running into some problems. Basically I have a loop, and I'm trying to create functions within that loop. Here is the code:
So the end result should be a set of functions called "result0", "result1", "result2", and so on...).Code:for (i=0; i < 10; i++){ var newFunction = "result" + i; function newFunction(event:MouseEvent ){ //do something } }
I've tried different variations of that code, but with no luck. If anyone has any ideas, it would be appreciated!!




Reply With Quote