PDA

View Full Version : Detecting mouse outside stage



Kirbyprime
June 19th, 2009, 09:17 PM
Was wondering if anyone knows how to solve this.

I have a swf that needs to change states based on whether or not the mouse is hovering over the swf or if it's outside.

I've tried doing things such as stage.addEventListener(MouseEvent.MOUSE_OUT, fnc) but it triggers whenever the mouse goes past different movieclips within the swf.

And since I have interactive elements, I can't just slap a movieclip over everything and add a listener to that.

So if anyone knows how I can handle this, I'd be very grateful.

Thanks in advance.

theCodeBot
June 19th, 2009, 09:31 PM
stage.addEventListener(MouseEvent.ROLL_OUT,leftSta ge);
stage.addEventListener(MouseEvent.ROLL_OVER,entere dStage);

then use MOUSE_OVER and MOUSE_OUT for individual items within.

Kirbyprime
June 19th, 2009, 09:37 PM
Thank you! That works fine. :angel: