Follow mouse question

How can i make this action script only work in a specific area of the flash doc? and only move horizontally?

onClipEvent (load) {
_x = 500;
_y = 375;
speed = 10;
}
onClipEvent (enterFrame) {
endX = _root._xmouse-50;
endY = _root._ymouse-50;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

Thanks