Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3357420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:37:49+00:00 2026-05-18T02:37:49+00:00

I’m using the Alert.show in a function and I want to get the user

  • 0

I’m using the Alert.show in a function and I want to get the user answer from there. So how can I achieve this. The problem is the function that call Alert.show will return a true or false value depend the user answer.
but It seem that in Alert.show it only allow to pass in a CloseHandler for this. that is a new function. and since that I can get the user answer from where it is call to return the user answer.

Really thanks for help
Yuan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:37:50+00:00Added an answer on May 18, 2026 at 2:37 am

    Try this code

    <?xml version="1.0" encoding="utf-8"?>
    <!-- Simple example to demonstrate the Halo Alert control. -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx">
    
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import mx.events.CloseEvent;
    
                // Event handler function uses a static method to show
                // a pop-up window with the title, message, and requested buttons.
                private function clickHandler(evt:Event):void {
                    Alert.show("Do you want to save your changes?", "Save Changes", Alert.YES|Alert.NO, this, alertClickHandler);
                }
    
                // Event handler function for displaying the selected Alert button.
                private function alertClickHandler(evt:CloseEvent):void {
                    if (evt.detail == Alert.YES) {
                        status.text = "You answered Yes";
                    } else {
                        status.text = "You answered No";
                    }
                }
    
                // Event handler function changes the default Button labels and sets the
                // Button widths. If you later use an Alert with the default Buttons, 
                // you must reset these values.
                private function secondClickHandler(evt:Event):void {
                    Alert.buttonWidth = 100;
                    Alert.yesLabel = "Magenta";
                    Alert.noLabel = "Blue";
                    Alert.cancelLabel = "Green";
    
                    Alert.show("Select a color:", "Color Selection", Alert.YES|Alert.NO|Alert.CANCEL, this);
    
                    // Set the labels back to normal:
                    Alert.yesLabel = "Yes";
                    Alert.noLabel = "No";
                }
            ]]>
        </fx:Script>
    
        <s:Panel title="Halo Alert Control Example"
                width="75%"
                horizontalCenter="0" verticalCenter="0">
            <s:VGroup left="10" right="10" top="10" bottom="10">
                <s:Label color="blue"
                        text="Click the button below to display a simple Alert window."/>
                <s:Button label="Click Me" click="Alert.show('Hello World!', 'Message');"/>
    
                <mx:HRule width="100%" />
    
                <s:Label color="blue" 
                        text="Click the button below to display an Alert window and capture the button pressed by the user."/>
                <s:Button label="Click Me" click="clickHandler(event);"/>
                <s:Label id="status" fontWeight="bold"/>
    
                <mx:HRule width="100%" />
    
                <s:Label color="blue"
                        text="Click the button below to display an Alert window that uses custom Button labels."/>
                <s:Button label="Click Me" click="secondClickHandler(event);"/>
            </s:VGroup>
        </s:Panel>
    
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I am currently running into a problem where an element is coming back from
I want to construct a data frame in an Rcpp function, but when I
I want to show the soap response to UIWebview.. my soap response is, <p><img
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.