Drag a clip with intertia

I found this in the archives here at Kirupa but am having trouble applying this to my movieclip.

MovieClip.prototype.inertialDrag = function(ratio, decel) {
var x, y, xspeed, yspeed, drag;
this.onEnterFrame = function() {
if (!drag) {
this._x += xspeed *= decel;
this._y += yspeed *= decel;
} else {
x = this._x;
y = this._y;
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
}
};
this.onPress = function() {
drag = true;
};
this.onRelease = this.onReleaseOutside=function () {
drag = false;
xspeed = (this._x-x)*ratio;
yspeed = (this._y-y)*ratio;
};
};
// usage
myMovieClip.inertialDrag(.1, .95);

How do I actually apply these actions to my movieclip? I tried imagecontainer.intertialDrag… but that didn’t work. Also, it’s complaining about assigning variables with the name x and y. Anyone wanna help me out?