A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Flash two keys pressed problem. HELP

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    1

    Flash two keys pressed problem. HELP

    Hello, i am working with flash cs5 and i have a basic actionscript code that looks like this:
    Actionscript Code:
    this.onKeyDown = function() {
    if (Key.isDown(Key.SPACE)) {
    gotoAndStop(2);
    }
    }
    This makes it so when i press on space it will gotoAndStop 2... But i put another code below it:
    Actionscript Code:
    this.onKeyDown = function() {
    if (Key.isDown(Key.UP)) {
    gotoAndStop(2);
    }
    }

    And it works but the only problem is that it will only read one of them, so space will link it to frame 2 and vice versa, any way i can get them to both work at the same time?

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    This?

    Actionscript Code:
    this.onKeyDown = function() {
        if (Key.isDown(Key.SPACE) && Key.isDown(Key.UP)) {
            gotoAndStop(2);
        }
    }
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center