Setting limits for movement that follows mouse

Hi, I followed the Kirupa “Mouse Follow with Easing” tutorial, and have a couple of movie clips moving slowly up and down, following the mouse. However, instead of applying this effect to a small movie clip (such as the ball in the tutorial), I have used white movie clips that extend beyond the background image. I would like to limit the movement up and down, so that instead of actually reaching the mouse, the movie clip stops while it still looks like it may extend indefinitely above and below the background image.

I’m fairly new to actionscript, and am unsure of the best way to approach this. Should I try to use hitTest with a blocker movie clip above and below, as used in the “Creating Continuous Movement” tutorial? If so, how do I incorporate my current code into an if/else statement? Alternatively, is there a way of setting a minimum and maximum y value or maximum amount of movement from a movie clip’s original position?

I hope this question doesn’t seem too basic… and thank you in advance for any help or pointers to relevant information. My current code is below:

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