A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Key 65(letter a) Only works once

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Key 65(letter a) Only works once

    I was making w,a,s, and d controls for a game with AS3 and pressing Key 65(a) only works the first time. Found below is a code that demonstrates how this only happens to key 65.

    I have a Mac OS X Snow Leopard and I am using Flash Professional CS5. Can someone let me know what would be the problem?


    Thanks




    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);

    function keyPressed(evt:KeyboardEvent):void
    {
    switch(evt.keyCode)
    {
    case (68) :
    trace("right key is pressed");
    break;
    case (65) :
    trace("left key is pressed");
    break;
    default :
    break;
    }
    }

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    Works fine on a PC, CS5 windows 7 pro.

    When you're previewing the swf click control, then disable keyboard shortcuts and see if that does anything for you.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    2
    Disabling the keyboard shortcuts in the control menu actually didn't work. At least I know now that it's probably a problem with mac's. Thanks

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