# Multiple this.onEnterFrames at once?

**URL:** <https://forum.kirupa.com/t/multiple-this-onenterframes-at-once/187184>\
**Category:** flash\
**Created:** [April 27, 2006, 8:11am UTC](https://forum.kirupa.com/t/multiple-this-onenterframes-at-once/187184 "2006-04-27T08:11:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ozymandias](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ozymandias/32/1997_2.png) [@Ozymandias](https://forum.kirupa.com/u/Ozymandias)\
**Post date:** [April 27, 2006, 8:11am UTC](https://forum.kirupa.com/t/multiple-this-onenterframes-at-once/187184/1 "2006-04-27T08:11:03Z")

</div>

Is there some way to create\delete multiple this.onEnterFrames for the same element? Like if you wanted it to expand and fade out over time simultaneously but wanted it in 2 seperate functions, and to stop at 2 seperate points.

Example:

MovieClip.prototype.shrink = function() {  
this.onEnterFrame = function() {  
this.\_xscale -= 10;  
this.\_yscale -= 10;  
if (this.\_xscale == 100) {  
this.swapDepths(this.depth);  
delete this.onEnterFrame;  
}  
};  
};  
//////////////////////////////////////////////  
MovieClip.prototype.fadeOtherOut = function() {  
this.onEnterFrame = function() {  
for (f=1; f\<total; f++) {  
this.tpic = eval(“_root.pic_”+f);  
if (this.tpic != this) {  
this.tpic.\_alpha -= 5;  
this.tpic.\_alpha -= 5;  
if (this.tpic.\_alpha == 50) {  
delete this.onEnterFrame;  
}  
}  
}  
};  
};

Both are applied to the same element so when one triggers the delete the other is also deleted. I tried making a dummy movieclip for each function to be the onEnterFrame trigger, but then I don’t get to use This and I’m not sure how to pass which pic I’m on into the onEnterFrame if I do it that way.
