# Trace() after prototype runs it's course

**URL:** <https://forum.kirupa.com/t/trace-after-prototype-runs-its-course/202082>\
**Category:** Uncategorized\
**Created:** [September 27, 2006, 3:41pm UTC](https://forum.kirupa.com/t/trace-after-prototype-runs-its-course/202082 "2006-09-27T15:41:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [September 27, 2006, 3:41pm UTC](https://forum.kirupa.com/t/trace-after-prototype-runs-its-course/202082/1 "2006-09-27T15:41:42Z")

</div>

where in this code can i put a simple trace() to run after the “4” in the array reaches an alpha of zero? I assume I’ll need to delete this.onEnterFrame; as well?

```auto

stop();

MovieClip.prototype.OpacityTransition = function (max, min, step) {
	this.messages = new Array("1","2","3","4");
	this.max = max;
	this.min = min;
	this.step = step;
	this.counter = 1;
	this.fadeIn = true;
	this._alpha = min;
	this.message = this.messages[0];
	this.onEnterFrame = function ()	{
		if (this.fadeIn) {
			this._alpha += this.step;
			}else{
			this._alpha -= this.step;
			}
		if (this._alpha <= this.min || this._alpha >= this.max)	{
			this.fadeIn = !this.fadeIn;
			if (this.fadeIn) {
				this.message = this.messages[this.counter++];
				if (this.counter >= this.messages.length) {
					this.counter = 0;
					
				}
				
			}
		}
	};
};
message.OpacityTransition (100, 0, 5);

```
