_global.magnet = 500; _quality = "LOW"; MovieClip.prototype.addProperty("x", function () { this.$x = this._x;ASSetPropFlags( this, ["$x"], 7, 1); return this.$x;}, null); MovieClip.prototype.addProperty("y", function () { this.$y = this._y;ASSetPropFlags( this, ["$y"], 7, 1); return this.$y;}, null); MovieClip.prototype.useHandCursor = 0; 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; }; |