Problem
You need to organize a drag and drop effect. And when the user drops the movie clip on the stage, the movie clip must appear in the original position (when the user drags this movie clip.)
Solution
Tracking movie clip coordinates. To do this we need to create 2 variables originalPositionX and originalPositionY. Also we will use the existing coordinates of movie clip, and for this we will use this.x and this.y.
Detailed explanation
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class DragDrop extends MovieClip {
var originalPositionX:Number;
var originalPositionY:Number;
public function DragDrop() {
trace("class DragDrop working");
this.addEventListener(MouseEvent.MOUSE_DOWN,
dragFlower);
this.buttonMode=true;
}
private function dragFlower(event:MouseEvent):void {
trace("starting dragFlower working");
this.startDrag();
this.addEventListener(MouseEvent.MOUSE_UP, dropFlower);
originalPositionX=this.x;
originalPositionY=this.y;
}
private function dropFlower(event:MouseEvent):void {
trace("dropFlower working too");
this.stopDrag();
this.removeEventListener(MouseEvent.MOUSE_UP,
dropFlower);
this.x=originalPositionX;
this.y=originalPositionY;
}
}
}

