Elasticity Function in MX

Hi does anyone know how to write an elasticity function in MX?

This works in 5 - but I want to use dynamic masking also - here’s the code (slightly modified from Ilyas Usal. Ilyas is also known as ilyaslamasse )

MovieClip.prototype.move = function (centerx,centery,inertia,k) {

x = -this._x + centerx ;
y = -this._y + centery ;

xp = xp * inertia + x*k ;
yp = yp * inertia + y*k ;

_x += xp ;
_y += yp ;

}

this goes in the movieclip:

onClipEvent (load) {
newx = this._x;
newy = this._y;

}

onClipEvent (enterFrame) {

this.move (newx,newy,0.45,0.5);

}

then you can set newx and newy how ever you want buttons or timeline.

I need it to work in MX - any suggestions?

-DWC