Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member Red Racer's Avatar
    Join Date
    Jul 2010
    Posts
    20
    Member #
    22720
    Hello people. OK, in my flash game in AS2 i am currently trying to pause the game. My current script works but when my game loops back to the the same frame then the function does not work. But if you loop it again then the function works.

    this is my current script
    //pause start
    _root.attachMovie("pause","pause",1000);
    _root.pause._x = 250;
    _root.pause._y = 150;
    //make pause invisible
    _root.pause._visible = false;
    //make pause variable
    var paused = false;


    var listener = new Object();
    listener.onKeyUp = function() {
    var code = Key.getCode();
    if (code == 80) {
    if (paused == false) {
    paused = true;
    } else {
    paused = false;
    }
    }
    };

    Key.addListener(listener);

    I need to somehow reset the function but i don't know anyway to do that in AS2, I know that in AS3 i could just use a void.

    Thanks in advance

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Try null.

  4. #3
    Junior Member Red Racer's Avatar
    Join Date
    Jul 2010
    Posts
    20
    Member #
    22720
    I just found another way. I put Key.removeListener(listener); on the next frame which wiped it.

    Thanks for the tip anyway.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

flash as2 pause code

Click on a term to search for related topics.
All times are GMT -6. The time now is 08:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com