# Removing onEnterFrame's

**URL:** <https://forum.kirupa.com/t/removing-onenterframes/174079>\
**Category:** flash\
**Created:** [January 2, 2006, 5:10pm UTC](https://forum.kirupa.com/t/removing-onenterframes/174079 "2006-01-02T17:10:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trundrumbalind](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trundrumbalind/32/696_2.png) [@trundrumbalind](https://forum.kirupa.com/u/trundrumbalind)\
**Post date:** [January 2, 2006, 5:10pm UTC](https://forum.kirupa.com/t/removing-onenterframes/174079/1 "2006-01-02T17:10:53Z")

</div>

Hey, I’m having problems deleting code in an onEnterFrame block on a movieclip. Here’s an example:

onClipEvent(load) {  
this.tX = this.\_x;  
this.\_x += 360;  
}  
onClipEvent(enterFrame) {  
if (this.\_x != this.tX) {  
this.\_x -= 5;  
} else {  
delete this.onEnterFrame;  
}  
}

I’ve got this working in Flash MX 2004 Professional before but now I’m on a machine that only has Flash MX. Does anyone know how I can get this line, third from the bottom to work?

Many thanks,  
Dave
