I'm making a game where the player must avoid random falling objects. I dont know how to implement pausing. I've been stuck on this for 2 days!

I tried using gotoAndPlay and such, but the objects continue to run in the background. When I resume the game, they're still falling and it seems like the frame resets and loads new random falling objects.

(Simple English would be appreciated; English isn't my mother tongue.)

  • 1
    \$\begingroup\$ I don't know ES2 specifically, but generally pausing is implemented with an if-statement in your game loop, which replaces the usual game updates as long as the game is paused. (That XNA solution should be a good starting point.) \$\endgroup\$ – Anko Oct 20 '14 at 17:19
  • \$\begingroup\$ Lol They're fixing my questions, it's the actionscript 2 by the way.. \$\endgroup\$ – user3132527 Oct 20 '14 at 22:58

I hope this example will helpful for you here i have two frames MainIntro and Gameplay if i cick the button of play then it moves to the next frame of GamePlay and then invoke the functions. Here i used gotoAndStop()..


import flash.display.MovieClip;
import flash.events.MouseEvent;
import com.greensock.*;
import com.greensock.easing.*;

import Globe;

public class MainIntro 

    public function MainIntro(Mc:MovieClip) 
        Globe.self.realstage = Mc;

        Mc.intro_mc.play_mc.addEventListener(MouseEvent.CLICK, GameStart);
        Mc.intro_mc.play_mc.buttonMode = true;
        Mc.intro_mc.ins_btn.buttonMode = true;


    public function GameStart(e:MouseEvent):void

        var gameply:GamePlay = new GamePlay();


  • \$\begingroup\$ This in no way answers the question asked. \$\endgroup\$ – Draco18s May 24 '17 at 14:13
  • \$\begingroup\$ To avoid more downvotes in the future I suggest you read the help page on providing high quality answers: gamedev.stackexchange.com/help/how-to-answer \$\endgroup\$ – Honeybunch May 24 '17 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.