# MC gets deleted before it can hit the last coords

**URL:** https://forum.kirupa.com/t/mc-gets-deleted-before-it-can-hit-the-last-coords/82262
**Category:** Uncategorized
**Created:** [March 8, 2005, 10:14pm UTC](https://forum.kirupa.com/t/mc-gets-deleted-before-it-can-hit-the-last-coords/82262 "2005-03-08T22:14:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Napoly](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@Napoly](https://forum.kirupa.com/u/Napoly)
#### Post date: [March 8, 2005, 10:14pm UTC](https://forum.kirupa.com/t/mc-gets-deleted-before-it-can-hit-the-last-coords/82262/1 "2005-03-08T22:14:59Z")

</div>

I’m trying to save some CPU resorces here but donno how… my MC script is deleted before it can reach the current point… what should I do?..

MovieClip.prototype.moveIt = function() {  
this.onEnterFrame = function() {  
menu.\_x = Math.round(border.\_x - ((border.\_width/2) + 68))+5;  
menu.\_y = Math.round(border.\_y - border.\_height/2)+5;  
if (Math.abs(menu.\_x - (Math.round(border.\_x - ((border.\_width/2) + 68))+5))\<1 && (Math.abs(menu.\_y - (Math.round(border.\_y-border.\_height/2)+5))\<1)) {  
delete this.onEnterFrame;  
}  
}  
};
