
package {
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.geom.*;
	public class sliderDialoug extends MovieClip {
		
		var slider:MovieClip;
		var boundsRect:Rectangle;
		/*
		*  @public
		*  class constructor, activates the button mode for the slider
		*/
		public function sliderDialoug(MySlider:MovieClip) {
			
			slider = MySlider;
			slider.bar_mc.pointer.buttonMode = true;
			slider.bar_mc.pointer.mouseChildren = false;
			slider.bar_mc.pointer.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
			
			var totalDrag = slider.bar_mc.dragWid.width - 18 ; 
			boundsRect = new Rectangle(12, 0, totalDrag, 0);
		}

		/*
		*  @public
		*  starts the drag process
		*/
		function pickUp(e:MouseEvent):void {
			e.target.startDrag(false, boundsRect);
			slider.parent.parent.addEventListener(MouseEvent.MOUSE_UP, dropIt);
			
		}
		
		/*
		*  @public
		*  ends the drag process
		*/
		function dropIt(event:MouseEvent):void {
			
			stopDrag();
			slider.releaseDrag();
			
			slider.parent.parent.removeEventListener(MouseEvent.MOUSE_UP,dropIt);
		}
		
		
	}
}