Need help stopping a alpha fade

this works but repeatidly fades in and out. I need to know how stop this after one loop and where to insert the script.

MovieClip.prototype.fade = function(minAlpha, maxAlpha, speed) {
this.onEnterFrame = function() {
if (!this.trigger) {
this._alpha -= speed;
if (this._alpha<=minAlpha) {
this._alpha = minAlpha;
this.trigger = true;
}
} else if (this.trigger) {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
this.trigger = false;

                    }
                    
                {
                }
            }
    };

};
clipToFade.fade(0, 100, 5)