Mobile Device BACK KEY PRESS Exit


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

Allows for EXIT function on mobile device via mobile device BACK key button.


Copy this code and paste it in your HTML
  1. //ITS THE RIVERA ERA
  2. //THE FIRST PUERTO RICAN URBAN AMERICAN DEVELOPER
  3. import flash.events.Event;
  4. import flash.events.KeyboardEvent;
  5.  
  6. stage.addEventListener(Event.ENTER_FRAME, handlekeys);
  7.  
  8. function handlekeys(event: KeyboardEvent):void
  9. {
  10. if (event.keyCode == Keyboard.BACK)
  11. {
  12. NativeApplication.nativeApplication.exit();
  13. }
  14. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.