
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// This prototype created for fadeIN & fadeOUT on MoviClip.
//
// Parameters:
// fadeType ("in" or "out")
// spd (1 to 99) It is the speed of fade
// endAlpha (0 to 100) It is the initial alpha state of your MovieClip
//
// Usage:
// movieClip.fade( "in", 10, 0 );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
MovieClip.prototype.fade = function( fadeType, spd, endAlpha )
{
if( endAlpha == undefined )
endAlpha = this._alpha;
else
this._alpha = endAlpha;
this.onEnterFrame = function()
{
switch( fadeType )
{
case "in" : this._alpha += spd;
break;
case "out" : this._alpha -= spd;
break;
}
if( this._alpha <= 0 )
{
this._alpha = 0;
delete this.onEnterFrame;
}
else if( this._alpha >= 100 )
{
this._alpha = 100;
delete this.onEnterFrame;
}
};
};









