se usi mx ecco:
codice:mio_mc.xpos = mio_mc._x; mio_mc.ypos = mio_mc._y; mio_mc.ease = .2; mio_mc.onPress = function() { this.startDrag(false); }; mio_mc.onRelease = function() { this.stopDrag(); }; pulsante.onPress = function() { mio_mc.onEnterFrame = function() { this.distancex = (this.xpos - this._x) * this.ease; this._x += this.distancex; this.distancey = (this.ypos - this._y) * this.ease; this._y += this.distancey; if ((this._x < this.xpos + 1 && this._x > this.xpos - 1) && (this._y < this.ypos + 1 && this._y > this.ypos - 1)) { this._x = this.xpos; this._y = this.ypos; delete this.onEnterFrame; } }; };

Rispondi quotando