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 7707403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:21:05+00:00 2026-06-01T00:21:05+00:00

Can I listen to Alert button click between components using AsyncToken? Basically, I want

  • 0

Can I listen to Alert button click between components using AsyncToken?
Basically, I want to have a method that opens an Alert with buttons and have it return an AsyncToken so that other components calling that method can listen for button click.

Example:

var token:AsyncToken=methodThatOpensAlert();
token.addResponder(new mx.rpc.Responder(buttonClick));

What’s the way to do that?
Thank you.

  • 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-06-01T00:21:06+00:00Added an answer on June 1, 2026 at 12:21 am

    You might be able to use an AsyncToken to achieve this but you could also just register for custom events that you dispatch from the pop up, this is a much cleaner method IMO. Really you’ve got two relatively clean options I can think of. 1 you make your pop-up dispatch events like “okClicked” “cancelClicked” for different button clicks within the pop-up, you create an instance of the pop up and add listeners then call PopUpManager.addPopUp, or else you do PopUpManager.createPopUp and keep a reference to the returned display object (the instance of the pop-up it created) and add your listeners then. 2 you make two properties in the pop up typed as function, you use them as call backs, so when you create the pop-up you set the okClickedFunction and cancelClickedFunction (or whatever your buttons may be) then in the pop-up you put cilck handlers on the buttons, check to see if the appropriate call-back function is set and call it if so, like

    if(okClickedFunction)
        okClickedFunction();
    

    Let me know if you have a specific need that makes you think you must use the AsyncToken, but from checking out the docs it looks as though it’s strictly meant to work with the other RPC methods and lots of properties are read-only.

    EDIT:

    [SomeUtilClass.as]

    private static function methodThatOpensAlert():CustomAlert
    {
        return PopUpManager.createPopUp(Application.application, CustomAlert) as CustomAlert;
    }
    

    [CustomAlert.as]

    [Event(type="flash.events.Event", name="button1Clicked")]
    [Event(type="flash.events.Event", name="button2Clicked")]
    
    private function button1Clicked_handler(event:MouseEvent):void
    {
        dispatchEvent(new Event("button1Clicked", true));
    }
    private function button2Clicked_handler(event:MouseEvent):void
    {
        dispatchEvent(new Event("button2Clicked", true));
    }
    

    [ThingThatUsesAlert]

    var ca:CustomAlert = SomeUtilClass.methodThatOpensAlert();
    ca.addEventListener("button1Clicked", button1ClickHandler);
    ca.addEventListener("button2Clicked", button2ClickHandler);
    

    And I believe mouse events bubble by default anyhow still so you could really just listen for a click event on the pop up then use the event.target to determine if it was one of the buttons your interested in.

    Let me know if you can make sense of this or need more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any notification I can listen to that will alert me that the
I'm trying to figure out how I can listen to the Cancel button that
How can I listen to data pushed by the server using http connection ?
In GWT, Is there a font resize event that I can listen to to
I am creating an Activiti controller that can listen for messages and fork off
I'm looking for a DOM event that I can listen to with JavaScript for
Is there a cross device hard button in android that a background service can
I have several event listeners configured to listen for a click event on a
Is there a way how modules can listen to parent application event? My current
I can't seem to find a way to listen for new producer and consumer

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.