not so much a problem as something is bugging me…
the problem is that mc is actually a 2px wide line so if i attach mouse_out listener as in code below, when mouse gets out of that line (which happen too easily and always) the dragging stops.
and if i dont attach mouse_out listener then if i drag out of the stage and let go i get an error (which i could catch) but also mc stays locked to my mouse although its not mouse_down any more till i click again…
mc.addEventListener(MouseEvent.MOUSE_DOWN, startDragging, false, 0, true);
function startDragging(e:MouseEvent):void {
e.target.startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_OUT, stopDragging, false, 0, true);
}
function stopDragging(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.removeEventListener(MouseEvent.MOUSE_OUT, stopDragging);
e.target.stopDrag();
any solution?