OK, slight variation:
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);
popUpTitleWindow.setFocus();
}
HTH
Steve
--- In [email protected], "ilikeflex" <ilikef...@...> wrote:
>
> Hi valdhor
>
> Thanks for your solution and it works but the issue is that i cannot
> do
>
> popUpTitleWindow = new PopUpTitleWindow();
>
> every time. I want to use only one instance of the popUpTitleWindow .
>
> Thanks
> ilikeflex
>
> --- In [email protected], "valdhor" valdhorlists@ wrote:
> >
> > 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" <ilikeflex@> 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
> > >
> >
>