0 Replies Latest reply on Mar 16, 2009 12:14 PM by TySteck

    3 keys simultaneously won't work in as3?

      I was writing some code for a top-down game in flash CS3 (as3), where a hero would be able to move in 8 directions(using the arrow keys) and shoot (using the spacebar) simultaneously.

      I ran into a problem with these keys working simultaneously, so I made a simple example to troubleshoot the issue. I started by making a square on the stage that's 50 pixels by 50 pixels, turning it into a movie clip and making it a class that my code uses, named "myBox".

      I made an example that detects the keys that are pressed and lowers their opacity in response. I wanted to test all eight directions with the spacebar. All combinations work, except when you hold "up arrow" + "left arrow" + "spacebar"

      This would make it impossible for my hero character to move up-left and shoot at the same time. Bummer! Why do all the other combinations work, except for up-left and spacebar?

      Any help would be greatly appreciated. Is this a limitation of flash?

      My code is attached: