Pausing onEnterFrame

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?

“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?

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


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