When I first started out in the game programming world, on of the hardest things for me to figure out was hour to let a user pause a game. It turns out a lot of people have trouble with this.
It's actually VERY simple: var paused:Boolean = false; addEventListener(Event.ENTER_FRAME, update); function update(e:Event):void { If(!paused){ //...insert regular code here }else{ //maybe a add a pause menu or something } }
EXPLINATION: Really, all we're doing here is temporarily stoping the game from going to the next frame (updating) until the paused variable is true.
var paused:Boolean = false _root.onEnterFrame = function(){ if(!paused){ //...insert regular code here }else{ //maybe a add a pause menu or something } }