# Oppisite of delete onEnterFrame?

**URL:** <https://forum.kirupa.com/t/oppisite-of-delete-onenterframe/260473>\
**Category:** flash\
**Created:** [May 16, 2008, 12:05am UTC](https://forum.kirupa.com/t/oppisite-of-delete-onenterframe/260473 "2008-05-16T00:05:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjmorga](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jjmorga](https://forum.kirupa.com/u/jjmorga)\
**Post date:** [May 16, 2008, 12:05am UTC](https://forum.kirupa.com/t/oppisite-of-delete-onenterframe/260473/1 "2008-05-16T00:05:24Z")

</div>

onEnterFrame = function(){  
if(such and such){  
delete this.onEnterFrame;  
}else if(such and such){  
start this.onEnterFrame;  
}

}

whats the proper syntax for this one? thanks so much!

---

<div class="post-metadata">

**Author:** ![JBPresents](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JBPresents](https://forum.kirupa.com/u/JBPresents)\
**Post date:** [May 16, 2008, 3:01am UTC](https://forum.kirupa.com/t/oppisite-of-delete-onenterframe/260473/2 "2008-05-16T03:01:39Z")

</div>

var follow:Boolean = true;

onEnterFrame = function(){

if(follow){  
do something;  
if(such and such){  
follow = false;  
}  
}  
else{  
do other stuff;

}  
};

basically you had the idea already you just didn’t understand how to use your if statements properly there is no need to change your onEnterFrame at all just put the big if statement in front to decide what to do
