I was thinking this is a simple task, but I\'m wrong.
I used a sprite to display an image, and when user drag it(MOUSE_DOWN and MOUSE_MOVE), I got the position in
If you're looking for smooth dragging experience, here is a method you could use: (let's say the thing you're dragging is called 'dragee' and this code is in the scope of dragee's parent)
function startDragging():void {
dragee.addEventListener(Event.ENTER_FRAME,dragUpdate);
}
function stopDragging():void {
dragee.removeEventListener(Event.ENTER_FRAME,dragUpdate);
}
var decay:Number = .25; //1 is no decay, .1 would be cazy slow
function dragUpdate(e:Event):void {
dragee.x += decay * (mouseX - dragee.x);
dragee.y += decay * (mouseY - dragee.y);
}