# getObjectsUnderPoint to basic

**URL:** <https://forum.kirupa.com/t/getobjectsunderpoint-to-basic/286905>\
**Category:** flash\
**Created:** [April 22, 2009, 4:04pm UTC](https://forum.kirupa.com/t/getobjectsunderpoint-to-basic/286905 "2009-04-22T16:04:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samroni](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@samroni](https://forum.kirupa.com/u/samroni)\
**Post date:** [April 22, 2009, 4:04pm UTC](https://forum.kirupa.com/t/getobjectsunderpoint-to-basic/286905/1 "2009-04-22T16:04:04Z")

</div>

since i couldn’t find any answer from googling, i’m pretty sure, this will be the answer to all.

my problem is really simple yet i can’t solve it.

How do you get a name from getObjectsUnderPoint ?

====================

i have 3 movieclips made manually, **a** , **b** and **c**.

**a** is on stage. **b** and **c** are inside **a**.

the code is this

```auto

stage.addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event)
{
    var obj:Array = stage.getObjectsUnderPoint(new Point(mouseX, mouseY));
    
    if (obj[obj.length-1]) trace(obj[obj.length-1].name);
}

```

now if i test it, the output will be:

instance1  
instance1  
instance1  
instance2  
instance2  
instance2  
instance3  
instance3

and so on…

we expect to see **a** , **b** and **c** in the output panel. How do you do that?

thank you all
