Adobe Dreamweaver Forums



Last 10 THreads :         Disabling flash display in Air HTML Component (Last Post : ReisenderJosh - Replies : 0 - Views : 1 )           »          repeated javascript function on same page (Last Post : aonefun - Replies : 0 - Views : 1 )           »          Live stream player (Last Post : noobie_here - Replies : 0 - Views : 1 )           »          cfloop within a cfif tag (Last Post : Azadi - Replies : 2 - Views : 3 )           »          Making constraints on a symbol... (Last Post : sirkibble2 - Replies : 0 - Views : 1 )           »          Creating a boundry in the stage... (Last Post : fazstp - Replies : 2 - Views : 3 )           »          Director or Flash? (Last Post : Sean Wilson - Replies : 1 - Views : 2 )           »          DW8 Activation not working (Last Post : moonliner - Replies : 0 - Views : 1 )           »          Re: Mouse capture won't activate (Last Post : robertnagle - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-09-2008, 12:40 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Close Popup (not application) when Press Esc

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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-09-2008, 01:16 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Close Popup (not application) when Press Esc


"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


Reply With Quote
  #3 (permalink)  
Old 10-09-2008, 09:23 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Close Popup (not application) when Press Esc

So I guess you are saying in the event handler for key presses, check what object has focus, and if it is the popup, close that, and not the component? I'll try that. Thanks Amy!
Reply With Quote


  #4 (permalink)  
Old 10-09-2008, 09:23 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Close Popup (not application) when Press Esc

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();
}
}
}

Reply With Quote
  #5 (permalink)  
Old 10-09-2008, 01:42 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Close Popup (not application) when Press Esc


"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 ;-)


Reply With Quote
  #6 (permalink)  
Old 10-09-2008, 04:41 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Close Popup (not application) when Press Esc

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.

:-) ;-) :-( :-)

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 02:44 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk