Help with a simple scrollbar class

I’ve written a basic scrollbar class (still learning how to structure a class) and it works OK but there’s a bug and I’m not sure how to fix it. The problem occurs when defining the boundaries of the bar that drags up and down the slider. Everytime the mouse is clicked, the boundaries are reset, allowing the drag movieclip to travel beyond where I want it to go. How can I fix this??

Here’s what I’ve written:

package
{
import flash.events.Event;
import flash.geom.Rectangle;
import flash.events.MouseEvent;
import flash.display.MovieClip;

public class ScrollBox extends MovieClip
{

	
	public function ScrollBox()
	{
		drag.buttonMode = true;
		drag.addEventListener(MouseEvent.MOUSE_DOWN, dragMouseDown);
	}
	public function dragMouseDown(evt:MouseEvent):void
	{
		var bounds:Rectangle = new Rectangle(drag.x,drag.y,0,scrollBar.height - drag.height);
		drag.buttonMode = true;
		drag.startDrag(false,bounds);
		stage.addEventListener(MouseEvent.MOUSE_UP, dragMouseUp);
		addEventListener(Event.ENTER_FRAME, scrollText);
	}
	public function dragMouseUp(evt:MouseEvent):void
	{
		drag.stopDrag();
		stage.removeEventListener(MouseEvent.MOUSE_UP, dragMouseUp);
		removeEventListener(Event.ENTER_FRAME, scrollText);
	}
	public function scrollText(evt:Event):void
	{
		var percentScrolled:Number = (drag.y - scrollBar.y) / (scrollBar.height - drag.height);
		container_mc.y = percentScrolled * (scrollBar.height - container_mc.height) + scrollBar.y;
	}

}

}

Thanks in advance for any help!