da qualche parte definisci:
codice:
MovieClip.prototype.fadeIn = function(alpha_max, fade_step) {
this.alpha_max = (alpha_max != undefined) ? alpha_max : 100;
this.fade_step = (fade_step != undefined) ? fade_step : 1;
this.onEnterFrame = function() {
this._alpha += this.fade_step;
if (this._alpha>=alpha_max) {
delete this.onEnterFrame;
delete this.alpha_max;
delete this.fade_step;
}
};
};
MovieClip.prototype.fadeOut = function(alpha_min, fade_step) {
this.alpha_min = (alpha_min != undefined) ? alpha_min : 0;
this.fade_step = (fade_step != undefined) ? fade_step : 1;
this.onEnterFrame = function() {
this._alpha -= this.fade_step;
if (this._alpha<=alpha_min) {
delete this.onEnterFrame;
delete this.alpha_min;
delete this.fade_step;
}
};
};
poi nel ciclo:
codice:
thumbHolder.onRollOver = function() {
this.fadeIn(100,2);
};
thumbHolder.onRollOut = thumbHolder.onDragOut=function () {
this.fadeOut(50,2);
};