Know when mouse is out of flash window

I have a follow mouse action and i want the box that follows to “dissapear” when the mouse no longer are in the flash window.

I have tried to search a script that have that but in all I’ve found the box allways stops in the window in different positions depending on where the mouse exit.