I'm trying to figure out the logic of a game I'm making, the plan is to store a set of functions into an array or vector with each function having a parameter of some kind.
The problem is that when i try to push a function with parameters into the Array, the method gets called because of the (), like this:
arr.push(someFunction(2));
Also if i have this:
var arr:Array = new Array();
arr.push(someFunction(2));
arr[0]();
It obviously won't work because the last line isn't passing any parameters.
Is there an easy way to accomplish this? I guess I could pass an Object or pass an Array as parameter instead, but maybe I'm just missing something.