Daniel So you're probably using your own timer to trigger the animation, instead of a passedTime variable passed to you from Starling, right? If you change that, the problem should go away. Or you limit that value yourself to a reasonable maximum.
I am just using this mainTimer
to display time on the screen in hh:mm:ss
format other than the time ticking, there is no other animation happening on the screen. When the mainTimer
is set/complete, it would display TIMES UP
.
private function onStageDeactivate(e:flash.events.Event):void {
star.stop(true);
pausedTime = flash.utils.getTimer();
StateManager.pause();
Flox.logEvent("Stage Deactivated");
}
private function onStageActive(e:flash.events.Event):void {
Flox.logInfo("Stage Activated");
star.start();
if (stage) stage.quality = stage.quality;
if (pausedTime > 0) {
elapsedTime = Math.round((flash.utils.getTimer() - pausedTime) / 1000);
Flox.logInfo("Elapsed Time = {0}", elapsedTime);
StateManager.updateTimer(elapsedTime);
}
pausedTime = 0;
}
This is how I am calculating elapsedTime
.
My requirement is simply this, if a user deactivates the game and the timer was displaying 05:00:00
at that moment. When the user comes back to the app exactly after 4 hours, the timer should now display 00:59:59
and start ticking from there~
Anything below 6335
seconds works just fine but when its over it, app crashes, which is strange!