# Embedded HitTesting

**URL:** https://forum.kirupa.com/t/embedded-hittesting/218484
**Category:** programming
**Created:** [March 8, 2007, 4:56am UTC](https://forum.kirupa.com/t/embedded-hittesting/218484 "2007-03-08T04:56:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Holmesc](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Holmesc](https://forum.kirupa.com/u/Holmesc)
#### Post date: [March 8, 2007, 4:56am UTC](https://forum.kirupa.com/t/embedded-hittesting/218484/1 "2007-03-08T04:56:51Z")

</div>

In my current game project, I have need of hitTest-ing an object on the main timeline to one embedded in another MC, using a shapeFlag. My code was/is:

MC1.onEnterFrame = function() {  
if(this.hitTest(\_root.MC2.MC3.\_x, \_root.MC2.MC3.\_y, true)) {  
\_root.myFunction(this);  
}  
}

Or something close akin to that. However, it doesn’t work. I suspect this is because MC3’s x and y coordinates are in relation to the reference point thingy of MC2. But, I don’t know how to fix it. Thanks much!
