# Why delete this.OnEnterFrame is not working?

**URL:** https://forum.kirupa.com/t/why-delete-this-onenterframe-is-not-working/190921
**Category:** flash
**Created:** [June 15, 2006, 6:34pm UTC](https://forum.kirupa.com/t/why-delete-this-onenterframe-is-not-working/190921 "2006-06-15T18:34:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [June 15, 2006, 6:34pm UTC](https://forum.kirupa.com/t/why-delete-this-onenterframe-is-not-working/190921/1 "2006-06-15T18:34:51Z")

</div>

Can someone see in this code why the delete is not working? (I commented out the y movement to test to see if it was stopping when x = 10, but it’s not. What am I doing wrong?

```auto
function moveCBS() {
	clearInterval(moveCBSInterval);
	_root.container2.onEnterFrame = function() {
			this._x -=5;
			//this._y -=5;
		if (this._x>10) {
			this._x = 10;
			delete this.onEnterFrame;
		}
		}
}
moveCBSinterval = setInterval(moveCBS, 1000);

```
