clip.onEnterFrame = function(){ if(this._currentframe == this._totalframes){ delete this.onEnterFrame; this.removeMovieClip(); } }