# Embedded HitTesting

**URL:** https://forum.kirupa.com/t/embedded-hittesting/218486
**Category:** Uncategorized
**Created:** [March 8, 2007, 4:58am UTC](https://forum.kirupa.com/t/embedded-hittesting/218486 "2007-03-08T04:58:52Z")
**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:58am UTC](https://forum.kirupa.com/t/embedded-hittesting/218486/1 "2007-03-08T04:58:52Z")

</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:

```
 ActionScript Code:
 [FONT=Courier New][LEFT]MC1.[COLOR=#0000ff]onEnterFrame[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
  [COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]hitTest[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]MC2[/COLOR].[COLOR=#000080]MC3[/COLOR].[COLOR=#0000ff]_x[/COLOR], [COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]MC2[/COLOR].[COLOR=#000080]MC3[/COLOR].[COLOR=#0000ff]_y[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]myFunction[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR][COLOR=#000000])[/COLOR];
  [COLOR=#000000]}[/COLOR]

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

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 :puzzle: . Thanks much! NOTE: I know that I posted this question twice, and my apologies. I think I hit back on my browser and accidentally recent the message.
