I ran into a problem with apply. I’ve always used delegate and delegate plus, and havent had to deal with apply directly.
The problem is when i try to add parameters to the function.
// adding one function to the que, with random parameters as an array
_aQueue.push({func:initMask, args:[_mcSummary]}, {func:tweenAll, args:["2", "3", "432"]});
trace(typeof(_aQueue[0].args)) // outputs ARRAY
trace(_aQueue[0].args) // outputs content of array
// apply the function
_aQueue[0].func.apply(this, _aQueue[4].args);
function initMask(whatever:Array):Void {
trace(whatever) // outputs the FIRST element that was in the array
trace(typeof(whatever)) outputs STRING if the first element is a string, outputs mc if the first element is an mc
}
Why do the parameter get ****ed up? I’ve checked the docs, and as far as i understod its supposed to be an ARRAY of parameters.
Any help appreciated!