Mod function *edited*

Hi

there is a better way of doing on enterframe but I have forgotten it…

my version… in progress

 
function fade(mcTarget:MovieClip,newAlpha:Number,speed:Number):Void{
mcTarget.onEnterFrame = function():Void{
mcTarget._alpha+=(newAlpha-mcTarget._alpha)/(10/speed);
if (Math.abs(Math.round(mcTarget._alpha))==newAlpha) delete this.onEnterFrame;
}
}

thanks:bu: