MovieClip.prototype.alpha = function(vel, to) { this.vel = vel; this.to = to; this.alpha_init = this._alpha; this.onEnterFrame = function() { //updateAfterEvent(); if (this.to != undefined && this.vel != undefined) { if (this.to>this.alpha_init) { if (this._alpha<=this.to) { this._alpha += this.vel; } else { this.onEnterFrame = null; } } else { if (this._alpha>=this.to) { this._alpha -= this.vel; } else { this.onEnterFrame = null; } } } else { } }; };