2

I have trouble understanding the path the EnterFrame Event takes for Propagation. I understand that Events have 3 Phases: Capturing, AtTarget und Bubbling.

When I look at the flash.events.Event class I see that Event does not Bubble.

If I add an Eventlistener on any DisplayObject it receives the Enter frame event. If I do the same with useCapture = true no Event is received.

But shouldn't all Events pass through the capturing phase? If I check the Event target it returns the receiving DisplayObject as its target.

Does the target for the EnterFrame event get changed while propagating or is a new Event created and passed to every DisplayObject?

Does Flash keep a separated List with all DisplayObjects? Because the EnterFrame event is even received when the DisplayObject is not added to the Display Tree?

4

1 回答 1

2

ENTER_FRAME (from AS3 Reference)

This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

So back to your question(s):

If I add an Eventlistener on any DisplayObject it receives the Enter frame event. If I do the same with useCapture = true no Event is received.

useCapture = true // this will not do anything, as ENTER_FRAME has no a "capture phase"

But shouldn't all Events pass through the capturing phase?

Only events which have "capture phase"

If I check the Event target it returns the receiving DisplayObject as its target.

This is correct

Does the target for the EnterFrame event get changed while propagating or is a new Event created and passed to every DisplayObject?

It is sent individually to each target.

Does Flash keep a separated List with all DisplayObjects? Because the EnterFrame event is even received when the DisplayObject is not added to the Display Tree?

This is answered in Sunil D comment

于 2013-06-03T19:49:53.507 回答