Sul frame
codice:
MovieClip.prototype.tweenTo= function (x,y,steps) {
this._xstep=(Number(x)-this._x)/Number(steps);
this._ystep=(Number(y)-this._y)/Number(steps);
this._steps=steps;
this.onEnterFrame=function () {
if (this._steps) {
this._x+=this._xstep;
this._y+=this._ystep;
this._steps--;
}
else {
delete this._xstep;
delete this._ystep;
delete this._steps;
delete this.onEnterFrame;
}
}
}
supponendo che il mc da spostare sia istanziato mc
richiami la proto
codice:
mc.tweenTo(0,400,30);//0=posizione x da raggiungere 400=pos Y, 30 velocità/step
ovviamente puoi mettere il richiamo o su un frame o associarlo al pulsante