Drag with easing

I’d like to create a movie clip that can be dragged around a stage but when the user releases the mouse, I want the mc to ease out in the direction the person dragged it rather than just a hard drop! Hope you all can figure out what I mean.

Anyway, I’ve pretty much sorted out the code for that part:

_root.myMC.ease = 2;
_root.myMC.onPress = function() {
this.drag = true;
_root.myMC.onEnterFrame = function() {
if (this.drag == true) {
this.targX = _root._xmouse;
this.targY = _root._ymouse;
if (this._x != this.targX | this._y != this.targY) {
this._x += (this.targX-this._x)/this.ease;
this._y += (this.targY-this._y)/this.ease;
_root.myMC.onMouseUp = function() {
this.drag = false;

The problem is the starting position of the mc. Everytime I test the movie, the drag-able mc moves to the top left corner of the stage. Why is this happening? How can I define the starting position for the drag-able mc?

Also, how can I constrain the mc to a specific boundry, I just realised that it is possible to throw the mc off the visible part of the stage (not good hehe).

I’ve attached the file.

Thanks guys!