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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:03:33+00:00 2026-05-19T04:03:33+00:00

I have a problem where I dispatch an event in a model class which

  • 0

I have a problem where I dispatch an event in a model class which is dispatched correctly. When trying to listen to this in the client, nothing is listened to. Client.as instantiates all MVC elements such as:

var _biosModel:IMultiDataModel = new BiosPanelModel();

A user click invokes an ‘update’ method within ‘BiosPanelModel.as’ like so:

override public function update():void
{
    debug("[BiosPanelModel.update]");
    dispatchEvent(new Event(Event.CHANGE)); // dispatch event
}

Client.as then tries to listen to this dispatched event but doesn’t and I don’t know why!? like so:

this._biosModel.addEventListener(Event.CHANGE, eventHandler);

eventHandler is not called!

Hope someone can help me as I feel like this should be simple! 🙁

Thanks for reading

Chris

  • 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-19T04:03:34+00:00Added an answer on May 19, 2026 at 4:03 am

    I would start by trying to set the bubbles parameter to true. So, dispatch the event like so:

    dispatchEvent(new Event(Event.CHANGE, true));
    

    This will keep you from having to listen to the event explicitly on the dispatcher and will allow the event to be captured in the bubbling phase.

    EDIT
    This IS NOT the end-all, be-all answer… and you will likely want to remove the bubbles = True once you get it working correctly, unless you want to explicitly cancel the event after you capture it. The reason being is the Event.CHANGE event is a pretty common one, and bubbling that event up the Display List chain could be messy, especially if there are other handlers listening for CHANGE events. But, it WILL let you know whether you are attaching your listener correctly.
    END EDIT

    The other thing you might want to try (since it is not apparent from the way you have your code written above) is to add the event listener immediately after creation of the instance. Alse, make sure your _biosModel is an instance property, not defined within the scope of some function that generates it.

    package ... {
    
        import flash.events.Event;    
    
        public class Something extends SomethingElse {
    
            var _biosModel:IMultiDataModel;
    
            public function Something() {
                this._biosModel = new BiosPanelModel();
                this._biosModel.addEventListener(Event.CHANGE, __eventHandler);
            }
    
            private function __eventHandler($evt:Event) {
                trace("SUCCESS");
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.