Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash Event Phases?

Could someone simply explain the 3 phases in the Flash Event framework, please?

By event phases, I mean:

  • CAPTURING_PHASE
  • AT_TARGET
  • BUBBLING_PHASE

To be clear, I'm talking about flash.events.Event and subclasses.

An in-depth example would be fantastic. What happens when you click on a nested MovieClip?

like image 427
aaaidan Avatar asked Dec 08 '08 01:12

aaaidan


1 Answers

With event propagation you're dealing with three "phases" of an event (see Figure 2). Each phase represents a path or the location of an event as it works itself through the display objects in Flash that relate to that event. The three phases of an event are capturing, at target, and bubbling:

  • Capturing phase: This represents the parent objects of the target object from which the event originated. Any propagated event starts with the topmost parent (stage) and works down the display object hierarchy until reaching the original target.

  • At target phase: The target phase is the phase where the event is at the target object or the object from which the event originated. Unlike the capturing and bubbling phases, this phase always relates to only one object, the target object.

  • Bubbling phase: When an event "bubbles" it follows the reverse path of the capturing phase and works its way back up the parent hierarchy of the target object until reaching the top-most parent or stage.

Blatantly stolen from: Introduction to event handling in ActionScript 3.0

like image 127
grapefrukt Avatar answered Sep 28 '22 00:09

grapefrukt