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

  • Home
  • SEARCH
  • 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 922445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:01:55+00:00 2026-05-15T19:01:55+00:00

In Flex 3, when I use Alert.show(some text); I will get an alert message

  • 0

In Flex 3, when I use

Alert.show("some text");

I will get an alert message along with the OK button. When I press the OK button I get another alert message. I have tried the following code, but it’s not working.

Alert.show(" Simulation for " + id_formulator.nme + " Campaign", null, mx.controls.Alert.OK, this, alertListener, null, mx.controls.Alert.OK);

private function alertListener(eventObj:Event):void {
    if (eventObj.detail == mx.controls.Alert.OK) {
        Alert.show("next message");
    }
}
  • 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-15T19:01:55+00:00Added an answer on May 15, 2026 at 7:01 pm

    The problem is that in your function alertListener, you declared the parameter eventObj to be of type Event. The Event class doesn’t have a detail field. However, the CloseEvent subclass does. It also happens to be the type of the event dispatched by an Alert being closed.

    Also, you can only use the this keyword in a context where it has scope. So you need to wrap it inside an initialize function (rather than just float in static code. You’ll need to add initialize="showAlerts()" to the window in order for it to happen when the window is opened. Otherwise, just replace with your event of choice

    Additionally, I would suggest using the import directive, since it makes your code significantly shorter, and short code is easier to maintain.

    So your code should be:

    import mx.controls.Alert;
    import mx.events.CloseEvent;
    
    private function showAlerts():void {
        Alert.show("Simulation for " + id_formulator.nme + " Campaign", null, Alert.OK, this, alertListener, null, Alert.OK);
    }
    
    private function alertListener(eventObj:CloseEvent):void {
        if (eventObj.detail == Alert.OK) {
            Alert.show("next message");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

These days, I use Flex & Bison generated some codes to develop a SQL-parser
I have a flex application which use DragManager. When I'm loading this application into
We have a Flex application which doesn't currently use the Flex framework as an
I have to use flex 4 for the front end and php with Symfony
I'm wondering if anyone has tried to use Flex to power the front end
I need to create an application that will use Flex on the client side
I want to use Flex and Bison together. I have declared a union in
I am creating an EDM (Electronic document Management) system which will use Flex for
I have a complicated application. I use Flex 4.1 RSLs and custom RSLs for
I have a project for school where we need to use flex and bison.

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.