Tuesday, 12 March 2013

Event Bubbling, and Stop Propagation


Information found at this article - Introduction to event handling in ActionScript 3.0 is more demonstrative and easy to understand. It will enhance the above accepted answer by @Jason Sturges.
Event bubbling and event capturing are two faces of events. If you make the event.bubbles to false that means the event is marked as non-bubbling event.
bubbles: Indicates whether or not the event is an event that bubbles (and captures). This does not mean that the event went through or is going through a capture or bubbles phase, but rather it is a kind of event that can.
Below image (from the above article) shows how the event goes through the process.
Event capturing and bubbling
The difference of the stopPropagation() and stopImmediatePropagation() will be more clear in following images.
StopPropagation :
stopPropagation
StopImmidiatePropagation :
stopImmediatePropagation


Thanks for visiting..................................