Deleting a function

I am modifying a slider I made using this tutorial http://www.kirupa.com/developer/mx/slider.htm I am trying make it so if you click on the line the slider button will move to where your mouse clicked. I also want it to ease to that position. I used the as below which works fine, but after you click the line the dragger is disabled well sort of if you try and drag it it keeps easing back to where you last clicked the line. So I need to delete the onEnterFrame on the dragger right. Well I tried an if statement but its not working. Can anyone help


function slide(){
	xMove  =  line._xmouse;
	dragger.onEnterFrame  =  function(dragg)  { 
	loop = this._x  +=  (xMove-this._x)/easeSpeed;
	if (dragger._x == _parent.xMove) {
		delete dragger.onEnterFrame;
		}
	}
}

line.onPress = slide