hitTestPoint and frame rendering

Originally my question was going to be if hitTestPoint checks the point against where the object is or where it was last rendered, but I’m fairly certain now that it’s the latter, at least when shapeFlag is set to true. Although maybe render is the wrong word, since it still works with invisible objects. I suppose during the rendering phase it makes a note of the space the object takes up whether or not it’s rendered. If shapeFlag is set to false then it doesn’t really care since it’s so easy to just calculate the bounding box.

So my question is: what do I do about this?

The fla I’ve attached demonstrates the problem. Click anywhere to have the mover move towards the point where you clicked. While it’s still moving, click the switch button to have the whole box change its position in between ENTER_FRAME events. This makes it think there’s a collision, and I’m guessing the reason is that it’s able to calculate the position of the mover correctly (since it’s just a point) but not the position of the shape that it’s moving in. It’s testing a correct, updated position against an incorrect, old one, and so the hit test returns false.

As I’ve already mentioned the problem doesn’t occur when you’re only testing against the bounding box. I finally figured out I can fix the problem by updating after the mouse event of clicking the switch button. I’m wondering if anyone has any better solutions.

The fact that it wouldn’t test against a shape’s actual position is troubling to me, since that could easily screw up hit detection in a game where the camera is moving around all over the place and very accurate hit detection is needed. Is there a way to perform the tests after the frame has already rendered, perhaps an alternative to ENTER_FRAME? Or do I just always have to be super careful and make sure the hit detections are done before the display objects are moved around?