0

How to detect on which movieClip an event has fired in as2. I have made a list of duplicate movieclips and want to add click event on each movieclip and distinguish on which movieclip event has fird. I know the solution in as3 but need as2 solution for it. Please, help.

Meghanshi
  • 91
  • 14

1 Answers1

0

In AS2, when you assigned a function say using myButton.onRelease = myFunction;, within the function you can reference the caller simply using this:

function myFunction() {
 trace(this._name);
}

myButton.onRelease = myFunction; // will trace "myButton" when you click it
influjensbahr
  • 3,978
  • 1
  • 12
  • 12