# HitTest doesn't work in loaded mcs?!

**URL:** https://forum.kirupa.com/t/hittest-doesnt-work-in-loaded-mcs/188088
**Category:** flash
**Created:** [May 4, 2006, 1:25pm UTC](https://forum.kirupa.com/t/hittest-doesnt-work-in-loaded-mcs/188088 "2006-05-04T13:25:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flashpipe](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@flashpipe](https://forum.kirupa.com/u/flashpipe)
#### Post date: [May 4, 2006, 1:25pm UTC](https://forum.kirupa.com/t/hittest-doesnt-work-in-loaded-mcs/188088/1 "2006-05-04T13:25:18Z")

</div>

I’ve tried \_lockroot, as well as using \_root, this, setting a global variable to ‘this’ and using it, but nothing seems to work!?

I set up the attached files (testDrawPolyShell.swf loads drawPoly.swf), so that the first mouseClick uses attachMovie to add the poly and the second clip does a hitTest between the poly and the cursor position. It works fine stand-alone, but the hitTest doesn’t work in the loaded movie…here’s the code that’s in drawPoly.swf:

```auto
this._lockroot=true;
this.createEmptyMovieClip("draw_area", 5);
this.onMouseDown = function() {
        poly = new Object();
        poly.x = _xmouse;
        poly.y = _ymouse;
        draw();
};
function draw() {
    if (this.draw_area.start_point.hitTest(_root._xmouse, _root._ymouse, false)) {
        removeMovieClip(this.draw_area.start_point);
    } else {
        temp = this.draw_area.attachMovie("start_point", "start_point", 2);
        temp._x = poly.x;
        temp._y = poly.y;
    }
}

```

Any ideas??

Thanks!!!
