Assuming you are using a MOUSE_DOWN -> MOUSE_MOVE -> MOUSE_UP process, you could use this. It was originally used as the answer for someone wanting smooth drag and drop. You can see the answer here.
import flash.display.*;
import flash.events.*;
var startX:Number;
var startY:Number;
var shape:Sprite = new Sprite();
shape.graphics.beginFill(0x000000);
shape.graphics.drawRect(0,0,50,50);
shape.graphics.endFill();
this.addChild(shape);
shape.addEventListener(MouseEvent.MOUSE_DOWN,this.mouseDown);
function mouseDown(e:MouseEvent = null):void{
stage.frameRate = 60;
startX = stage.mouseX - shape.x;
startY = stage.mouseY - shape.y;
stage.addEventListener(MouseEvent.MOUSE_MOVE,this.mouseMove);
shape.addEventListener(MouseEvent.MOUSE_UP,this.mouseUp);
}
function mouseMove(e:MouseEvent = null):void{
shape.x = stage.mouseX - startX;
shape.y = stage.mouseY - startY;
}
function mouseUp(e:MouseEvent = null):void{
shape.removeEventListener(MouseEvent.MOUSE_UP,this.mouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.mouseMove);
stage.frameRate = 24;
}
Basically, to accomplish what you want, the MOUSE_MOVE event listener must be attached to the stage, rather than the Panel or Image. You listen for a MOUSE_DOWN (or right click) on the image, then add the MOUSE_MOVE and MOUSE_UP events. My framerate changes are unnecessary, but was needed in order to get the smooth drag that the original asker wanted. I also compensate for mouse position within the object in that code as well. The key is definitely to add the MOUSE_MOVE event to the stage and listen for stage.mouseX and stage.mouseY, rather than adding it to the Panel or image and listening for target.mouseX/mouseY or event.localX/localY.
I don't think this is being used for mobile, but if it is and you are using a forced DPI, make sure you use FlexGlobals.topApplication.systemManager.mouseX/mouseY instead of stage.mouseX and stage.mouseY. The SystemManager class accounts for DPI changes and the Stage class does not.