Removing Event

This code is nested in the movieclip.


import caurina.transitions.*;

var yOffset:Number;
var yMin:Number;
var yMax:Number;



function ScrollBar():void
		{
			sb.thumb.buttonMode = true;
			yMin = 0;
			yMax = sb.track.height - sb.thumb.height;
			sb.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
			addEventListener(MouseEvent.MOUSE_UP, thumbUp);
			
		}



function thumbDown(e:MouseEvent):void
{
	addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
	yOffset = mouseY - sb.thumb.y;
}

function thumbUp(e:MouseEvent):void
{
	removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
}




function thumbMove(e:MouseEvent):void
{
	sb.thumb.y = mouseY - yOffset;
	if(sb.thumb.y <= yMin)
		sb.thumb.y = yMin;
	if(sb.thumb.y >= yMax)
		sb.thumb.y = yMax;
	var sp:Number = sb.thumb.y / yMax;
	Tweener.addTween(body_txt, {y:(-sp*(body_txt.height-masker.height)), time:1});
	e.updateAfterEvent();
}

ScrollBar();



The problem is that, after several scroll, the event for “sb.thumb” cannot be removed. So, it always listening where the mouse on the stage move.

Thanks