# Delete onEnterFrame causes later code to not run

**URL:** https://forum.kirupa.com/t/delete-onenterframe-causes-later-code-to-not-run/154794
**Category:** Uncategorized
**Created:** [July 12, 2005, 7:57pm UTC](https://forum.kirupa.com/t/delete-onenterframe-causes-later-code-to-not-run/154794 "2005-07-12T19:57:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)
#### Post date: [July 12, 2005, 7:57pm UTC](https://forum.kirupa.com/t/delete-onenterframe-causes-later-code-to-not-run/154794/1 "2005-07-12T19:57:57Z")

</div>

i have this code:

```auto
gallery_mc.thumbs_mc.onEnterFrame = function() {
    if (this._currentframe == 95) {
        loadThumbs(0);
        delete this.onEnterFrame;
    } else if (this._currentframe == 105) {
for (var i:Number = 0; i < 10; i++) {
            var target:String = "gallery_mc.thumbs_mc.thumb" + i + "_mc.container_mc";
            thumbs_mcl.unloadClip(target);
        }
    }
};

```

problem is when i get to 95, everything works well, but when i get to 105, the onEnterFrame had already been deleted so that code doesnt run anymore. how can i accomplish this so that the code on 105 runs?

thanks in advance.
