Draggin a SWF

OK I have this script in to drag a movie clip with the mouse. BUT, how do I make it so that when you release the mouse button the clip stops dragging?

clip.onMouseDown = function() {
if(this.hitTest(_root._xmouse, _root._ymouse, true)) { //checks to see if the mouse clicked this clip
this.startDrag(false); //start dragging the clip
}
}

That’s what I have in already.

One more problem I just discovered. Is there any way posible to get dynamic text to show up underneath a mask?