Try this:
import mx.managers.PopUpManager;
public var popUpTitleWindow:PopUpTitleWindow = new
PopUpTitleWindow();
private function button_click(evt:MouseEvent):void
{
if(!popUpTitleWindow.isPopUp)
{
popUpTitleWindow = new PopUpTitleWindow();
}
PopUpManager.addPopUp(popUpTitleWindow, this, true);
}
--- In [email protected], "ilikeflex" <ilikef...@...> wrote:
>
> Hi
>
> I seen the example in the code link and it work fine
>
http://blog.flexexamples.com/2008/08/04/closing-a-pop-up-window-using-th\
e-keyboard-in-flex/
>
> but if i change the code in the View MXML to below
> <mx:Script>
> <![CDATA[
> import mx.managers.PopUpManager;
> public var popUpTitleWindow:PopUpTitleWindow;
> private function button_click(evt:MouseEvent):void {
>
> if(popUpTitleWindow == null)
> popUpTitleWindow = new PopUpTitleWindow();
>
> PopUpManager.addPopUp(popUpTitleWindow, this, true);
> }
> ]]>
> </mx:Script>
>
>
> it works fine for the first time but does not work second time.
>
> Second time the keyboard event is not being fired. I do not know why..
>
> Can anybody please provide workaround for this solution to make it
work.
>
> Thanks
> ilikelfex
>