Jump to content
Search Community

CornishCuc

Members
  • Posts

    2
  • Joined

  • Last visited

CornishCuc's Achievements

0

Reputation

  1. Fantastic, worked like a charm AND a speedy response. Thank you!
  2. 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? AS3: protected function pauseGame(event:MouseEvent):void { menu.removeEventListener(MouseEvent.CLICK, pauseGame); menu.addEventListener(MouseEvent.CLICK, resumeGame); TweenMax.pauseAll(true, true); stage.frameRate = 0; } protected function resumeGame(event:MouseEvent):void { menu.removeEventListener(MouseEvent.CLICK, resumeGame); menu.addEventListener(MouseEvent.CLICK, pauseGame); TweenMax.resumeAll(true, true); stage.frameRate = 30; }
×
×
  • Create New...