![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I have an AIR app and I display a component based on a menu selection. If user
presses Esc key, the component is closed (removed from display list). This works fine. If user clicks a button in the component, a modal TitleWindow is displayed as a PopUp. While the Popup is displayed and has focus, is user presses Esc the component closes, not the Popup. I have added a listener to the Popup for Esc key presses, but it doesn't seem to get the event. How can I have the Popup close on Esc when it is displayed and has focus? Thanks in advance! Greg |
| Sponsored Links |
|
|||
|
"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message news:gcjga9$h0t$1@forums.macromedia.com... >I have an AIR app and I display a component based on a menu selection. If >user > presses Esc key, the component is closed (removed from display list). This > works fine. > > If user clicks a button in the component, a modal TitleWindow is displayed > as > a PopUp. While the Popup is displayed and has focus, is user presses Esc > the > component closes, not the Popup. > > I have added a listener to the Popup for Esc key presses, but it doesn't > seem > to get the event. How can I have the Popup close on Esc when it is > displayed > and has focus? I think you can always get key press events on the stage, so I think you just have to check to see if the popup has focus and then close the popup. HTH; Amy |
|
|||
|
Your idea led to the answer Amy. Thanks so much.
private function keyDownListener(event:KeyboardEvent):void { if (event.charCode == Keyboard.ESCAPE) { if(focusManager.getFocus() != targetSelector.regexSyntaxHelpLink){ closeHandler(Event(event)); }else{ PopUpManager.removePopUp(targetSelector.regexHelpW indow); event.stopImmediatePropagation(); } } } |
|
|||
|
"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message news:gckd67$k4h$1@forums.macromedia.com... > Your idea led to the answer Amy. Thanks so much. > > private function keyDownListener(event:KeyboardEvent):void { > if (event.charCode == Keyboard.ESCAPE) { > if(focusManager.getFocus() != > targetSelector.regexSyntaxHelpLink){ > closeHandler(Event(event)); > }else{ > PopUpManager.removePopUp(targetSelector.regexHelpW indow); > event.stopImmediatePropagation(); > } > } > } You're welcome. I aspire to your chipperness ;-) |
|
|||
|
Ha... I have my moments! I'm not a perfectionist, but I'm seen the power of
attention to detail and being pro-active, and in a world of mediocrity, that can lead to ruffled feathers. :-) ;-) :-( :-) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise