Handling keyboard events globally : KeyboardEvent : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » KeyboardEvent »

 

Handling keyboard events globally


 
package {
  import flash.display.*;
  import flash.events.*;

  public class Main extends Sprite {
    public function Main (  ) {
      stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
    }

    private function keyDownListener (e:KeyboardEvent):void {
      trace("A key was pressed.");
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» KeyboardEvent


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0