actionscript 2.0 movieclip fade out and fade in function
Categorized under: Flash-Tips
Add to keyframe 1's actionscript layerMovieClip.prototype.fadeOut = function(alpha) {
this.onEnterFrame = function() {
//this._alpha=60;
this._alpha += (alpha-this._alpha)/2;
if (this._alpha == 0) {
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.fadeIn = function(alpha) {
this.onEnterFrame = function() {
//this._alpha=100;
this._alpha += (alpha-this._alpha)/2;
if (this._alpha == 100) {
delete this.onEnterFrame;
}
};
};
//you call this effect by adding it to any keyframe and use:
// yourmovieclipname.fadeOut(40);
//this fades the movieclip out to 40
— Zeus ::)
Jul 08, 2009








OMG Thanks! I was looking everywhere for this!
— Kat · Nov 18, 03:40 PM · #
You’re welcome Kat :)
I should post my other examples too :)
Cheers,
Zeus
— zeus · Nov 18, 10:15 PM · #
blog.zeusdidit.com