Setting Boundries

Does anyone know how to set boundries on a slow chase mouse follower. Attached is the fla im trying to set boundries to. The ball should not go past the red lines.

I have used the following code:

 
onClipEvent (load) {
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endY = _root._ymouse-200;
_y += (endY-_y)/speed;
}

-BlackFireMD :beard:

onClipEvent (load) {
	_y = 0;
	speed = 5;
}
onClipEvent (enterFrame) {
	endY = _root._ymouse-200;
	if ((_y + (endY-_y)/speed)<150 && (_y + (endY-_y)/speed)>-140) {
		_y += (endY-_y)/speed;
	}
}

This should work.

It worked! Thanks!! :beer: