Search code examples
flashactionscript-3programming-languagesclick

How to address the object that has been Clicked but not the children inside it?


inside a MouseEvent.CLICK function, I usually used e.target to address the movieClip that I clicked, but that only work with a movieClip that doesn't have any children (such as text and other symbols) inside. When it has children inside, the e.target return the child inside the Mc but not the Mc itself. The e.currentTarget didn't work, either; it returned [object MovieClip] but not the instance name of the Mc. Is there anyway I can fix it? thank you.


Solution

  • To get the instance name you would need e.currentTarget.name.