se hai Flash Player 7:
codice:
MovieClip.prototype.slowSetProperty = function(prop, newVal, b) {
var bb, prevVal;
bb = (b == undefined) ? 5 : b;
var prevVal = this[prop];
if (this["slowSPController"+prop] != undefined) {
this["slowSPController"+prop].removeMovieClip();
}
this.createEmptyMovieClip("slowSPController"+prop, this.getNextHighestDepth());
this["slowSPController"+prop].onEnterFrame = function() {
this._parent[prop] += (newVal-this._parent[prop])/bb;
if (Math.abs(this._parent[prop]-prevVal)<.01) {
this._parent[prop] = newVal;
this.removeMovieClip();
} else {
prevVal = this._parent[prop];
}
};
};
esempio:
codice:
clip.slowSetProperty("_x",50);
il terzo parametro è opzionale e serve a regolare la velocità.