KeyPress/keyboard events handling in Flex AS3


/ Published in: ActionScript 3
Save to your folder(s)

Use this code to handle keypress/keyboard events


Copy this code and paste it in your HTML
  1. public function init():void
  2. {
  3. txtBox.addEventListener(KeyboardEvent.KEY_UP,pressEscape);
  4. }
  5.  
  6. public function pressEscape(event:KeyboardEvent):void
  7. {
  8. if (event.keyCode==13)
  9. {
  10. Alert.show("Enter Key has been pressed");
  11. }
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.