Hey there
I've experience this problem in many forms.
public function startTimer() {
timer = new Timer(3000);
timer.addEventListener(TimerEvent.TIMER, timerTick, false, 0, true);
timer.start();
}
private function timerTick(e:TimerEvent) {
var bubble = new Bubble();
this.addChild(bubble);
}
Bubble
gets removed from the display after a certain amount of time. Imagine a water bubble in the floating up from the bottom of the screen, and getting removed when hitting the top.
If the flash window is left idle for around 20 minutes, then way too many Bubble
objects are created and shown on the display. There should only be around 5 on the screen (because they get removed), but there are way too many.
I think for some reason the timer events get clogged and when we come back to the browser window, all triggered at once. This is using firefox on the mac, but also happens in other browsers.
I have tried many things, including rewriting the timers using flash.utils.getTimer() (ie using the system clock), and using a recursive TweenLite.delayedCall.
Thanks for any tips and pointers