Pass an event handler function to the alert. Then in the handler
function use event.detail to check the action.

import mx.utils.Delegate;
function add(){
        mx.core.Application.alert("Are you sure this is
correct?","Warning",
        mx.controls.Alert.OK|mx.controls.Alert.CANCEL,
        Delegate.create(this, this.alertHandler));

}

function alertHandler(event){
        if(event.detail == mx.controls.Alert.OK){
                doWhatever();
        }
        }else{
                return;
        }
}

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Matthew Kuehn
Sent: Friday, August 26, 2005 3:28 PM
To: [email protected]
Subject: [flexcoders] Handling mx.controls.Alert.show() Yes/No Options
(Or A Better Way To Do It)

How does one determine which button the user clicked when showing an
alert with multiple buttons? For example:

mx.controls.Alert.show('Are you sure you want to do
that?','',mx.controls.Alert.YES | mx.controls.Alert.NO,this,'','',NO);

How do I determine if they clicked yes or no? Or, is there a preferred
way to do this? I can't seem to find any good examples.

Thanks,
Matthew





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to