Movie clip boundaries

hi there.

well i was wondering if anyone could help me with this little thing im trying to figure out.

I have a animated dot called player_mc that ive made follow the mouse cursor and ive also hid the mouse cursor with actionscript that all works fine but now what im wanting is to make it that they cant move the player_mc movieclip outside of the thin rectangle around it which is a movie clip called wall_mc.

Mouse.hide();
function dotmouse() {
    _root.player_mc._x = _xmouse;
    _root.player_mc._y = _ymouse;
}
var update:Number = setInterval(dotmouse, 20);

above is the code that does the moving with cursor stuff ive just exsplained thats no problem there works 100% just i as i said im wanting to make it that if they hit nething thats in the movieclip wall_mc the mouse stops like it hit a wall.

thanks ne solutions and a quick reply will be most appreciated.