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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:32:58+00:00 2026-05-30T17:32:58+00:00

I have a custom component called shopView which is an MXML skinnable component. I

  • 0

I have a custom component called shopView which is an MXML skinnable component. I have a controller class called ShopController which takes care of showing this component in popup, updating info shown in the component etc.

Now, I wanted to maniupate some of the subcomponents of this ShopView after it has been created from the controller after the ShopView is created (creationComplete() event)

So, I have attached an event listener which intern does some initialization process

   creationComplete="init(event)" 

the init() function

        private function init(event:FlexEvent):void{
            event.stopImmediatePropagation();
            initMenus();
            initSlots();
            dispatchEvent(event);
        }

Attached another creation complete event from the controller class

     _shop.addEventListener(FlexEvent.CREATION_COMPLETE,onShopCreated);

*_shop is the instance of ShopView*

Now, if you see the init() function, there I am stopping the event propagation, doing some initialization process and after that I am dispatching the event (for the shop controller do the rest of the job)

Now, this is crashing the app because the crationComplete event of the ShopView is recursively called. I was thinking the dispatchEvent will propagate to the other listerners but seems like it is propagating back to the same component.

I have fixed it by removing the e.stopImmediatePropagation() and dispatchEvent(event) lines from the init() function. But I want to know why it is happening like this?

Is it a known issue for the mxml/flex components? OR it is expected behavior?

Update: I am not doing same in .as as I said below. Got answer, basically its my stupidity 🙂

because I have not seen this behavior when I write .as classes where I
stopevent propagation and dispatch the event based on business logic.

Thanks in advance.

  • 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-30T17:33:00+00:00Added an answer on May 30, 2026 at 5:33 pm

    This is expected behavior.

    When you redispatch an existing event dispatchEvent automatically clones it (since you can’t dispatch the same event twice.) This clears any propagation-related flags.

    May I ask why you want to redispatch CREATION_COMPLETE in this situation anyway? Both handlers will function just fine without the two lines you removed.

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

Sidebar

Related Questions

I have a custom Swing component called NavigationLink which extends JLabel and implements a
I have a custom component which consists of 2 text view and 4 toggle
So I have a module in flex in which I add a custom component.
Let's say I have this custom component. It subclasses JMenuItem and all instances use
I have a custom UIComponent , which renders ok when called directly from the
Hi I have a class called ColorChooser (in the net.java.dev.colorchooser.ColorChooser package) This is a
I have a custom component as an item renderer. In this renderer there is
I have a custom component on which I have bound an array collection to
I have a custom component where I have implemented INotifyPropertyChanged and IBindableComponent . However,
I have a custom component, that contains a list of another components. If I

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.