-
[RESOLBED] using the letter keys?
I am very new to these forums.
I am just looking for a place to ask my questions. As I am very new to ActionScript 3. I just finished reading "Foundations of Game Design With Flash"
and now I am starting my first major flash project. Which is a flash game I call Solar Racer. It is just a racing game, in space, with the racers being pushed by Solar Wind.
But, I have run into a funny snag. Using event listners and such for the arrow keys is easy.
so I import the proper stuff
Code:
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
the event listener
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
and the Event Handeler
Code:
private function onKeyPressed(event:KeyboardEvent):void
{
trace(event.keyCode);
}
Which works great most of the time. If I hit the arrow keys, the associated key codes get spit out.
HOWEVER, if I hit the letter keys (in this case, I want to hit "p") Nothing happens!! It doesn't trace a number!
I suspect this has to do with the shortcut keys in flash. As "P" is the key for the "Pen" tool.
Does anyone know what exactly is going on, and how to get around it?
Thanks!
EvilTesla-RG
Last edited by EvilTesla; 01-20-2010 at 09:17 PM.
Reason: resolved
-
you're exactly correct, the shortcut keys override the Test Movie environment. you can see full functionality when running in a browser (although obviously trace wouldn't have much effect).
-
AH!
thank you
That's going to make things a little more difficult.
-
There should be a way to disable shortcuts in the test player, though I don't know it off the top of my head. Search the forums.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|