That worked great. Thanks! Goran
--- In flexcoders@yahoogroups.com, "Mercer, Dustin" <[EMAIL PROTECTED]> wrote: > Goran, > > > > There seems to be a typo in my last post... The confirm method should > look like this: > > > > private function confirm( event ) > > { > > switch ( event.detail ) > > { > > case 1: > > break; > > case2: > > break; > > } > > } > > > > > > _____ > > From: Mercer, Dustin > Sent: Tuesday, February 15, 2005 11:05 PM > To: flexcoders@yahoogroups.com > Subject: RE: [flexcoders] Alert event handling > > > > Goran, > > > > This code should help. > > > > PS. The event.detail contains the information needed to tell you which > button was clicked. I.E. 1 == YES and 2 == NO. Hope this helps! > > > > Import mx.controls.Alert; > > > > var alert = Alert.show("Are you sure you want to delete this item?", > "Confirm Delete", Alert.YES | Alert.NO); > > alert.addEventListener( "click", mx.utils.Delegate.create( this, confirm > ) ); > > > > private function confirm( event ) > > { > > switch ( event.detail ) > > case 1: > > break; > > case2: > > break; > > } > > > > _____ > > From: goran187 [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 8:03 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Alert event handling > > > > > Is anyone familiar with event handling on Alert boxes (buttons)? > > I have a form with an alert box with two button choices (OK and NO) > > I want to be able to execute a function based on the selected option. > > Thanks, > Goran > > > > > > > > > > > Yahoo! Groups Sponsor > > ADVERTISEMENT > <http://us.ard.yahoo.com/SIG=129v1mjjj/M=298184.6018725.7038619.300117 6/ > D=groups/S=1705007207:HM/EXP=1108623895/A=2532114/R=2/SIG=12k51v6pj/*h tt > p:/clk.atdmt.com/NFX/go/yhxxxnfx0020000014nfx/direct/01/&time=11085374 95 > 377058> > > <http://view.atdmt.com/NFX/view/yhxxxnfx0020000014nfx/direct/01/&time= 11 > 08537495377058> > > > <http://us.adserver.yahoo.com/l? M=298184.6018725.7038619.3001176/D=group > s/S=:HM/A=2532114/rand=572235806> > > > > _____ > > Yahoo! Groups Links > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/> .