They only hit when both red mcs are placed in the root, but not when they are in another mc. Why is that?
I think hitTest uses coordinates based on the global coordinate space, not the coordinates within a movie clip. so to make the hitTest work you could use localToGlobal to find the global coordinates of the clip, Code: onClipEvent (enterFrame) { this._y += 2; var pt = {x: this._x, y: this._y}; _parent.localToGlobal(pt); if (_parent.area.hitTest(pt.x, pt.y, true)) { trace("hit"); } }
onClipEvent (enterFrame) { this._y += 2; var pt = {x: this._x, y: this._y}; _parent.localToGlobal(pt); if (_parent.area.hitTest(pt.x, pt.y, true)) { trace("hit"); } }
Antonetti in '09
Oh, does it have to be so complicated?
Forum Rules