Few different ways (sorry for late reply, was on my honeymoon)
you can set a constraint for horizontal and vertival movement, or to an area of the screen.
set this code is from Lingo dictionary and changed for vertical movement
set the locV of sprite 1 to constrainV(2, the mouseV)
also see constrainH and constraint for variations on this.
This will only let the sprite move within the sprite in sprite channel 2.