ho questo prototype:
codice:
MovieClip.prototype.slowSetProperty = function(prop, newVal, b) {
var bb, prevVal;
bb = (b == undefined) ? 5 : b;
prevVal = this[prop];
this.onEnterFrame = function() {
this[prop] += (newVal-this[prop])/bb;
if (Math.abs(this[prop]-prevVal)<.01) {
this[prop] = newVal;
delete this.onEnterFrame;
} else {
prevVal = this[prop];
}
};
};
che uso così:
codice:
mioClip.slowSetProperty("_x", 100);
e fin qui tutto bene...
ma se voglio fare:
codice:
mioClip.slowSetProperty("_x", 100);
mioClip.slowSetProperty("_xScale", 200);
non posso farlo...
funziona solo la seconda chiamata che naturalmente cancella onEnterFrame della prima.
Come risolvo?