Scripting/constraining problem

ok everyone,

in the attached .fla is my problem…

what i have been trying to do, with no success is to keep the object that moves with the mouse (the blue rectangle) constrained within the red box.

what scripting do i use so that when the mouse pointer is out of the box, it is not controlling the blue rectangle???

i don’t want the blue rectangle hidden, which a mask would solve, rather, i don’t want it to move when the mouse pointer is out of it’s range, in this case outside of the red box.

i can’t figure this out - please help out if you can.

thanks a million!!