Hi guys!
I have a timer and I want to call a function once the interval I set expires, pretty standard.
But when I also want to pass a couple of extra arguments with the Timer parameters.
var timer:Timer = new Timer(500, 10);
var X:Number = 10;
timer.addEventListener(TimerEvent.TIMER, notifier**[pass extra args here]**);
// now I want to send this number X to the notifier function.
function notifier(event:TimerEvent, var total:Number = 0):void {
trace(timer.currentCount);
trace ("total: " + total);
}
timer.start();
This is only a snippet. I want to know how I’m to pass the extra arguments to the function.
Thanks in advance!