The life and times creating engaging media experiences.
« Previous | Main | Next »

Difference Between "target" and "currentTarget"

When adding an event listener to an object in your ActionScript 3.0 code, it is helpful to understand the difference between the "target" and "currentTarget" objects that can be referenced in the listener function that gets called after the event fires. The object obtained by referencing "target" is the object that dispatched the event. The object obtained by referencing "currentTarget" is the object that is listening for the event. With event bubbling, there can be a difference between the object that dispatched the event and the object that was listening for the event.

« Previous | Main | Next »