# onEnterFrame Pause

**URL:** <https://forum.kirupa.com/t/onenterframe-pause/28232>\
**Category:** flash\
**Created:** [August 11, 2003, 5:49pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232 "2003-08-11T17:49:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandsp5](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@grandsp5](https://forum.kirupa.com/u/grandsp5)\
**Post date:** [August 11, 2003, 5:49pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232/1 "2003-08-11T17:49:26Z")

</div>

Ok so I am making a new scroll bar (no one seemed to know hwo to fix my old one) and I am trying to add a slight pause to some of the buttons. For example, if you click the down button, it will scroll down a bit, pause, and if it is still held down .5 seconds later, it will continue scrolling. I know there have been numerous discussions on how to just pause a movie but I am wondering if there is any way to pause a handler? Could I have the onEnterFrame handler stop for half a second? If not, what would be the best way to go about doing this sort of pause on a scroll bar. Thanks everyone.

---

<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:** [August 11, 2003, 6:12pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232/2 "2003-08-11T18:12:24Z")

</div>

maybe you could have it be a movie clip and then have the onEnterFrame on the last frame of that clip, telling the parent to keep moving

---

<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:** [August 11, 2003, 6:14pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232/3 "2003-08-11T18:14:09Z")

</div>

yeah I think that would work. I was just wondering out of curiosity if there was any way to delay a handler

---

<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:** [August 11, 2003, 8:51pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232/4 "2003-08-11T20:51:21Z")

</div>

You could do that with setInterval too. In pseudo code:

```auto
this.myFunc () = function {
clearInterval (this.interval) ;
if ( someCondition) this.onEnterFrame = function () {
// do some other stuff
}
}

this.onEnterFrame = function () {
// do stuff
if (someConditionIsMet) {
delete this.onEnterFrame ;
this.interval = setInterval ( this, "myFunc", 500 ) ;
}

```

Something like that.

pom 🙂

---

<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:** [August 11, 2003, 8:54pm UTC](https://forum.kirupa.com/t/onenterframe-pause/28232/5 "2003-08-11T20:54:58Z")

</div>

can you try and explain what that does? I’m not sure i understand the code…pseudo code rather 🙂  
I can post a fla if you would like to see what I need it for.
