Hi guys.. I am trying to create a scroller...The videoSlider is my scrollBar and I want to drag it so my secondMC will move....everything works fine in my code but if I mouse down in my videoSlider and up outside of it....The drag state still apply and it's not what I desire....any ideas?? Thanks...
videoSlider.addEventListener(MouseEvent.MOUSE_DOWN, scrollMC);
videoSlider.addEventListener(MouseEvent.MOUSE_UP, stopScrollMC);
var eventTarget:Object; // to allow more global access to the dragged object
function scrollMC(event:MouseEvent):void{
eventTarget = Object(event.currentTarget);
eventTarget.startDrag(false,new Rectangle(0,0,500,0));
stage.addEventListener(MouseEvent.MOUSE_MOVE, adjust2ndX);
}
function stopScrollMC(event:MouseEvent):void{
eventTarget.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_MOVE, adjust2ndX);
}
function adjust2ndX(evt:MouseEvent):void {
secondMC.x = eventTarget.x;
}