1 Reply Latest reply on Dec 5, 2007 8:58 PM by atta707

    Global Event Dispatcher

    m_hartnett Level 3
      I have a Flex object that defines a listener:
      this.addEventListener("dbConnDataChange", dataChanged);

      I have a http service object with an onResult handler that will dispatch an event.
      model.appReference.dispatchEvent(new Event("dbConnDataChange",true));

      When I dispatch this event it is not caught in the the listener object.

      However if I add the listener to the Application mxml object it will be caught in the Application object.

      I thought that the dispatcher will walk the through all the children of the application and check for listeners but I must be missing something. Should this work?

      Thanks for any help
        • 1. Re: Global Event Dispatcher
          atta707 Level 2
          I can explain this, but I don't think I can do a better job than the docs:

          Handling events for display objects

          When Flash Player dispatches an event object, that event object makes a round-trip journey from the Stage to the display object where the event occurred. For example, if a user clicks on a display object named child1, Flash Player dispatches an event object from the Stage through the display list hierarchy down to the child1 display object.