i am having a problem with a popUp in my firstView aka HomeView. I used a similar logic as provided by the DashBoardMobile reference example: (http://www.adobe.com/products/flex/examples/)
when i open the PopUP i add a EventListener with the HandlerFunction to close the popUp if the device back-key is pressed:
systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler, false, 1000, true);
protected function deviceKeyUpHandler(event:KeyboardEvent):void
var key:uint = event.keyCode;
if (key == Keyboard.BACK)
So far this had worked fine (if a popUp is open its get closed, if no popUp is open the previous View is poped)
Now i made a popUp for the firstView of my app, and there this doesnt works, if i press the back-kay the application is closed wether the popUp is open or not...
You might want to try listening for the backKeyPressed event on the View instead: http://polygeek.com/4225_air-mobile_go-your-own-way-overriding-the-back-key-press-in-air-m obile-apps
In that handler if your popup is open you'll want to preventDefault() on the event and call your close logic.
i already tried this, but the same problem occours. This doesn't work in the firstView, if i press the back-button the app gets closed...