PDA

View Full Version : hit test point problem



scarjoh
January 27th, 2009, 07:29 AM
i have a setup like this, when the mouse cursor is invisible I put movieclip on stage like so:


stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
function redrawCursor(e:MouseEvent):void {
if (imageLoader.hitTestPoint(mouseX, mouseY, true)) {
Mouse.hide();
message_mc.visible = true;
message_mc.x = mouseX;
message_mc.y = mouseY;
e.updateAfterEvent();
} else {
Mouse.show();
message_mc.visible = false;
}

but for some reason the movieclip its flickering all the time on and off when i move the mouse, and on some places when i stop the mouse not even showing..
does anybody know why is this happening?

cbeech
January 27th, 2009, 10:44 AM
although the above code is missing the last right bracket for the conditional statement, i do not experience the behavior you're describing and it seems to work fine. are there any other codes that may be causing the issue, such as an event for the imageLoader that is not getting 'terminated'?

scarjoh
January 27th, 2009, 11:20 AM
no, i figured it out, i had swapChildren in this code also, and thats was causing it, so i moved that out.. now its fine :)