views:

360

answers:

1

Hi Experts,

I've this code in flex where I register a mouse out event listener -

... 
var b:Button = new Button(); 
b.addEventListener(MouseEvent.MOUSE_OUT, buttonOutHandler);
... 
private function buttonOutHandler(evt:MouseEvent):void { 
 ... 
}

Problem that I am facing is that sometimes when I move my mouse out of the display Object that is Button I don't receive an event for mouse out.

It is mostly when I move it fast out of the Button area. Am I doing anything wrong? Any suggestions on how to get this implemented so that I don't miss the event?

+1  A: 

You could try the rollOut event insted of the MouseOut. Very similar, but yet different. If whatever you've added the listener to has its own children then you should definatly use the rollOut event.

kenneth
Indeed, you'll almost always want to use MouseEvent.ROLL_OUT because it will be very rare that you'll need to know when the mouse rolls out of any individual display object that is a child of the one to which you're listening.
joshtynjala