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