Please have a look what's wrong w. this code

Hi,

I found a bit of code for “magnetic effx” but this works only with Flash player 6 and earlier.
Does anybody know how to make it work with FP 8.

Here is the code:

[COLOR=Navy]MovieClip.prototype.onEnterFrame = function()
{
if (this._name != “”)
{
if (!this.defaultX) this.defaultX = this._x;
if (!this.defaultY) this.defaultY = this._y;
magnet = 500;
this.X0 = this._x;
this.y0 = this._y;
this.X1 = _root._xmouse;
this.Y1 = _root._ymouse;
this.distanceX = this.X1-this.X0
this.distanceY = this.Y1-this.Y0
this.distance = Math.sqrt((this.distanceX * this.distanceX) + (this.distanceY * this.distanceY))
this.powerX = this._x - (this.distanceX / this.distance) * magnet / this.distance;
this.powerY = this._y - (this.distanceY / this.distance) * magnet / this.distance;
this.forceX = (this.forceX + (this.defaultX - this.X0) / 2) / 1.66
this.forceY = (this.forceY + (this.defaultY - this.Y0) / 2) / 1.66
this._x = this.powerX + this.forceX;
this._y = this.powerY + this.forceY;
}
}

[COLOR=Black]Thanks for any advice![/COLOR]
[/COLOR]