# hitTest function problems

**URL:** <https://forum.kirupa.com/t/hittest-function-problems/267025>\
**Category:** Uncategorized\
**Created:** [July 27, 2008, 5:10pm UTC](https://forum.kirupa.com/t/hittest-function-problems/267025 "2008-07-27T17:10:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![partimer](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@partimer](https://forum.kirupa.com/u/partimer)\
**Post date:** [July 27, 2008, 5:10pm UTC](https://forum.kirupa.com/t/hittest-function-problems/267025/1 "2008-07-27T17:10:50Z")

</div>

Hi folks - have an odd problem that I just can’t get to the bottom of.

I’ve an app that allows the user to add items (mc’s) to a stage (holder mc).

I’ve a tooltip function that works fine except when I’ve an item on top of another item - where the tooltip (hitTest) only picks up the bottom-most item.

Say for example I add a large square to myStage - then add a ‘table/chair’ item onto myStage and move it on top of the square - when the tooltip function is called it only ‘finds’ the bottom most layer - even tho the ‘table/chair’ has a higher depth than the square and does appear on top.

Any ideas at all - loosing sleep onver this thing!

Cheers,

Pt

```auto
 
for (var mc in myStage) {
 
 if (myStage[mc].hitTest(_root._xmouse, _root._ymouse, 1)) {
   if myStage[mc].tooltip_text != undefined) {
   _global.tooltip_target_mc = myStage[mc];
   }
 }
return;
}   
 

```
