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 yousure 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: [EMAIL PROTECTED]
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





Reply via email to