Detect if the mouse is outside the flash window

I have a background which scroll’s when the mouse is at the edge of the flash window - RTS style. If the mouse cursor goes outside the window I want it to stop scrolling, but flash reads the cursor position as the last place it was, when it was still within the flash window.

I know I’ve done this before, but I can’t at all remember how!

Is there an event I can listen for or something similar?

Thanks