To get the character code of something in AS3, add a keyboard event to the stage.
// keyboard event stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); function keyDownHandler(event:KeyboardEvent):void { if (event.keyCode == Keyboard.LEFT) { trace("LEFT!"); }
Tech Reference: AS3
Leave a Reply