
Код:
MovieClip.prototype.onEnterFrame = function() {
this.distanceX = _root._xmouse - this._x;
this.distanceY = _root._ymouse - this._y;
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.x-this._x)/2)/1.66;
this.forceY = (this.forceY+(this.y-this._y)/2)/1.66;
ASSetPropFlags(this, ["distanceX","distanceY","distance","powerX","powerY","forceX","forceY"], 1, 1);
this._x = this.powerX + this.forceX;
this._y = this.powerY + this.forceY;
};
можно ли как-то эту штуку оптимизировать ???
если можно то как ???