That was kind of hard to understand, but here's the point I'm making:

There is NO connection between a TitleWindows "close" event, and the 
PopUpManager. Unless you dispatch it yourself, the ONLY time a TitleWindow's 
"close" event gets dispatched is when the user clicks on the "closeButton" in 
the top right corner of the TitleWindow. The "close" event is NOT dispatched 
when the TitleWindow is removed by PopUpManager.

I reiterate: The "close" event is NOT dispatched when the TitleWindow is 
removed by PopUpManager.

The only reason I recommended that you dispatch the "close" event yourself, was 
BEFORE you told us that you wanted different behavior depending on whether the 
user clicks on the TitleWindow's closeButton or on some other button in the 
TitleWindow.


----- Original Message ----
From: markgoldin_2000 <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Monday, June 30, 2008 2:24:58 PM
Subject: [flexcoders] Re: Popup - listening to close


And now we are getting back to my original question:
popupWindow. addEventListener ("close", Handle);
does not dispatch button's click with code:
PopUpManager. removePopUp( this);

--- In [EMAIL PROTECTED] ups.com, Enjoy Jake <enjoy_jake@ ...> wrote:
>
> If you no longer dispatch the CloseEvent when the button is 
clicked, then handleCloseFromTitl eWindow shouldn't get clicked.
> 
> 
> 
> ----- Original Message ----
> From: markgoldin_2000 <markgoldin_ [EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] ups.com
> Sent: Monday, June 30, 2008 2:11:32 PM
> Subject: [flexcoders] Re: Popup - listening to close
> 
> 
> Still, handleCloseFromTitl eWindow is what gets executed when I 
click 
> on a button.
> 
> --- In [EMAIL PROTECTED] ups.com, Enjoy Jake <enjoy_jake@ ...> 
wrote:
> >
> > Try something like this:
> > 
> > <TitleWindow close="handleCloseF romTitleWindow( event)"/>
> > <Button click="handleCloseF romButton( event)"/>
> > 
> > private function handleCloseFromTitl eWindow(event: 
CloseEvent) :void {
> >   // Do something
> >   closeMe();
> > }
> > 
> > private function handleCloseFromButt on(event: MouseEvent) :void {
> >   // Do something similar
> >   closeMe();
> > }
> > 
> > private function closeMe():void {
> >   PopUpManager. removePopUp( this);
> > }
> > 
> > 
> > ----- Original Message ----
> > From: markgoldin_2000 <markgoldin_ 2000@>
> > To: [EMAIL PROTECTED] ups.com
> > Sent: Monday, June 30, 2008 12:35:16 PM
> > Subject: [flexcoders] Re: Popup - listening to close
> > 
> > 
> > Yes, Close event is dispatched in both cases now.
> > But I have another issue: Both clicks: titlewindow close and a 
> > regular button run same code:
> > Close button:
> > close="actionSelect ed = 'test';PopUpManager .removePopUp( this);"
> > regular button
> > click="dispatchEven t(new CloseEvent(CloseEve nt.CLOSE) ); 
> > PopUpManager. removePopUp( this);actionSele cted = 'test1'"
> > actionSelected = 'test' after either click.
> > But I need to know what was actually clicked.
> > 
> > --- In [EMAIL PROTECTED] ups.com, Enjoy Jake <enjoy_jake@ ...> 
> wrote:
> > >
> > > I thought the only time the framework dispatches the "close" 
> event 
> > on a popup is when the user clicks the close button (which only 
> shows 
> > up if showCloseButton == "true"). If you want to listen for 
> > the "close" event, you'll have to dispatch it yourself.
> > > 
> > > I recommend changing your code to
> > > 
> > > click="dispatchEven t(new CloseEvent(CloseEve nt.CLOSE) )"
> > > 
> > > and calling PopUpManager. removePopUp from an event listener.
> > > 
> > > Alternatively, you could do
> > > 
> > > click="dispatchEven t(new CloseEvent(CloseEve nt.CLOSE) ); 
> > PopUpManager. removePopUp( this)"
> > > 
> > > 
> > > ----- Original Message ----
> > > From: valdhor <stevedepp@ ..>
> > > To: [EMAIL PROTECTED] ups.com
> > > Sent: Monday, June 30, 2008 11:59:57 AM
> > > Subject: [flexcoders] Re: Popup - listening to close
> > > 
> > > 
> > > Makes sense to me.
> > > 
> > > Basically, closing the popup just changes its visibility. The 
> object
> > > is still available for reuse.
> > > 
> > > Using the PopUpManager to remove a popup destroys the object and
> > > removes it from the display list. It hasn't just been closed, 
it's
> > > been blown away.
> > > 
> > > --- In [EMAIL PROTECTED] ups.com, "markgoldin_ 2000"
> > > <markgoldin_ 2000@> wrote:
> > > >
> > > > Here is code:
> > > > 
> > > > var popupWindow: TitleWindow = new TitleWindow;
> > > > popupWindow = showPopupWindow( boxingArea, jobMaintenance) ;
> > > > popupWindow. addEventListener ("close", jobActions);
> > > > 
> > > > public function jobActions(event: Event):void 
> > > > {
> > > >         trace(event. target);
> > > > }
> > > > 
> > > > I am getting into jobActions when I click on Popup's close 
> button 
> > but I 
> > > > am not getting in there when I click on a regular Button (in 
> > popup) 
> > > > with code:
> > > > click="PopUpManager .removePopUp( this)"
> > > > This click closes the Popup window but no close event is 
> > triggered.
> > > > Is that right?
> > > > 
> > > > Thanks
> > > >
> > >
> >
>

    


      

Reply via email to