Posted By

RiveraEraGames on 06/01/14


Tagged

key mobile back as3 android exit


Versions (?)

Mobile Device BACK KEY PRESS Exit


 / Published in: ActionScript 3
 

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

  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  

You need to login to post a comment.