# Pausing onEnterFrame

**URL:** https://forum.kirupa.com/t/pausing-onenterframe/96006
**Category:** Uncategorized
**Created:** [December 3, 2003, 6:07pm UTC](https://forum.kirupa.com/t/pausing-onenterframe/96006 "2003-12-03T18:07:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bobaphatt](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bobaphatt](https://forum.kirupa.com/u/bobaphatt)
#### Post date: [December 3, 2003, 6:07pm UTC](https://forum.kirupa.com/t/pausing-onenterframe/96006/1 "2003-12-03T18:07:17Z")

</div>

hey, i have some Mc with a  
onClipEvent(enterFrame){doing some stuff}

and in the same mc, want to put a startDrag action, so i put in  
on(press) {startDrag, yadayada}, but i want to pause the onEnterframe{} while i press to drag…  
how can i pause it?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 10, 2003, 7:47pm UTC](https://forum.kirupa.com/t/pausing-onenterframe/96006/2 "2003-12-10T19:47:15Z")

</div>

“Static event handler go on the movieclip itself, not on a frame. These cannot be deleted or stopped. So to ‘pause’ the onEnterFrame, delete it when you start dragging, and set it back to the original function when you stop dragging”

How do I set it back to the original function?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 10, 2003, 7:54pm UTC](https://forum.kirupa.com/t/pausing-onenterframe/96006/3 "2003-12-10T19:54:56Z")

</div>

you have to have it first defined to some other name and then apply it back to the onEnterFrame. i.e.

```auto

myOEF = function(){
// stuff for onEnterFrame
}
onEnterFrame = myOEF;

// lalala

delete onEnterFrame; // to stop or 'pause' the enter frame code

// lalala

onEnterFrame = myOEF; // to reinstate or unpause it

```
