# A question about .target

**URL:** <https://forum.kirupa.com/t/a-question-about-target/263246>\
**Category:** flash\
**Created:** [June 13, 2008, 6:03pm UTC](https://forum.kirupa.com/t/a-question-about-target/263246 "2008-06-13T18:03:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![endy](https://avatars.discourse-cdn.com/v4/letter/e/f19dbf/32.png) [@endy](https://forum.kirupa.com/u/endy)\
**Post date:** [June 13, 2008, 6:03pm UTC](https://forum.kirupa.com/t/a-question-about-target/263246/1 "2008-06-13T18:03:30Z")

</div>

Hello all.

I am trying to do a .gotoAndPlay on a movieClip by clicking on it using an EventListener to call a function. I am able to make this work, however, when I put a movieClip inside the movieClip that I am referencing, it can’t find it. (I trace the name property and get “instance1” instead of the instance name.

Here is what I am doing:

```auto
myBut.addEventListener(MouseEvent.CLICK, doit);

function doit( e:Event ) {
	trace(String(e.target.name));
	trace(e.target.x);
}

```

And here is what traces to the output window:  
instance1  
0

Anyone know how to make this work?  
Thanks.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [June 13, 2008, 7:42pm UTC](https://forum.kirupa.com/t/a-question-about-target/263246/2 "2008-06-13T19:42:51Z")

</div>

target is the bottom-most display object in the hierarchy being clicked. Sounds like you want currentTarget which is the object you added the listener to.

---

<div class="post-metadata">

**Author:** ![endy](https://avatars.discourse-cdn.com/v4/letter/e/f19dbf/32.png) [@endy](https://forum.kirupa.com/u/endy)\
**Post date:** [June 13, 2008, 8:14pm UTC](https://forum.kirupa.com/t/a-question-about-target/263246/3 "2008-06-13T20:14:02Z")

</div>

Ah, that did it. Thanks so much!
