I came across a peculiar problem with Greensock today whilst playing with a 'pause' function for a game. The purpose of the two following functions are:
When the pause button (in this case it's a sprite named it 'menu') is pressed it causes all existing TweenMax instances to pause in place. It also sets the stage's framerate to 0, making all display objects pause in place. I've been told this is the best method pausing the game.
When the button is pressed again, it should resume all the tweens from where they were initially paused. However, the problem is these tweens jump to their finishing position regardless of when they were paused, so when I resume the game the tween finishes abruptly.
The strange thing is, if the framerate isn't changed (resumes at 30, for example), the Tweens resume from where they originally paused. Am I just being stupid and missing something obvious?
protected function pauseGame(event:MouseEvent):void
stage.frameRate = 0;
protected function resumeGame(event:MouseEvent):void
stage.frameRate = 30;