
Код AS3:
hero.addEventListener(MouseEvent.MOUSE_MOVE, heroStartDrag);
hero.addEventListener(MouseEvent.MOUSE_UP, heroStopDrag);
private function handleMouseMove(event:MouseEvent):void
{
if (event.buttonDown)
{
//do drag
hero.removeEventListener(MouseEvent.CLICK, heroClick);
}
}
function heroStopDrag(evt:MouseEvent):void {
trace("Stop Drag");
evt.currentTarget.stopDrag();
flagclick = false;
hero.addEventListener(MouseEvent.CLICK, heroClick);
}