2 Replies Latest reply on Nov 25, 2006 2:27 PM by peterent

    event propagation

    B.O.H.R.
      I've got folowing structure of components: MainWindow includes MinorCanvas includes SamlpeElement <- these are components,

      In which direction event dispathed in MinorCanvas will be propagated ? will reach MainWindow ? or SampleElement ? or both ?
        • 1. Re: event propagation
          as3isolib
          So you Application contains MinorCanvas which contains SampleElement? Your wording makes this a little unclear, "In which direction event dispathed IN MinorCanvas". Basically all events bubble up through the chain of components. You can think of bubbling up as in bubbling towards the Application. So if MinorCanvas dispatched the event, then SampleElement which is a child of MinorCanvas will not have the event pass through it. If SampleElement dispatched the event, then it will pass upwards through the MinorCanvas. Now if the event's bubbling = true, it will pass through the entire component chain until it reaches the Application level. This is how the Cairngorm FrontController fires off the appropriate command associated with a Cairngorm Event., No matter how deep a component is inside the component chain structure, the event bubbles upwards until it hits the application level where the singleton instance of the FrontController resides.
          • 2. Re: event propagation
            peterent Level 2
            The capture phase of events starts from the Application and works down to the component dispatching the event; bubbling phases works in the opposite direction. The first component to consume the event in the chain wins.