MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES User Manual Page 22

  • Download
  • Add to my manuals
  • Print
  • Page
    / 53
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 21
© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Condential.
Handling the Back key
private function initializeHandler(event:Event):void!
{!
!systemManager.stage.addEventListener(KeyboardEvent.KEY_DOWN,!
!!deviceKeyDownHandler);!
!systemManager.stage.addEventListener(KeyboardEvent.KEY_UP,!
!!deviceKeyUpHandler);!
}!
private function deviceKeyDownHandler(event:KeyboardEvent):void!
{!
!if (event.keyCode == Keyboard.BACK && mainNavigator.length > 1)!
!!event.preventDefault();!
}!
private function deviceKeyUpHandler(event:KeyboardEvent):void!
{!
!if (event.keyCode == Keyboard.BACK && mainNavigator.length > 1)!
!!mainNavigator.popView();!
}!
22
Page view 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 52 53

Comments to this Manuals

No comments