-1

what is the difference between target and current target in flash.events.event propagation ? And on which phase of event these two properties are same ?

Tahir Alvi
  • 896
  • 2
  • 14
  • 44

1 Answers1

2

The target is the element where the event has occured.

The currentTarget is the element that has the event handler that is running right now.

When something happens, for example the user clicks on something, that causes an event for the element that was clicked. That is the target element. If there is an event handler for that event on that element, it will be called. If the element is a bubbling event, it will "bubble up" through the parent elements and run any event handlers on the way, unless the code in an event handler specifically stops it from bubbling further.

When there is an event handler on the element where the event happens, the target and currentTarget will be the same for that handler.

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
Guffa
  • 687,336
  • 108
  • 737
  • 1,005