I have the code:
var timer:Timer = new Timer(milliseconds, repititions);
timer.addEventListener(TimerEvent.TIMER, callback);
timer.start();
and if a user click I want to call the callback early. Is there was a way to either force the timer to finish immediately, or stop it and send the TimerEvent.Timer on my own?
I’m looking for something simple like the tween classes fforward().
EDIT
The Solution was
timer.dispatchEvent(new TimerEvent(TimerEvent.TIMER));
I was trying to do timer.dispatchEvent(new TimerEvent("TIMER")); which doesn’t work.
1 Answer