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.
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
yeah I think that would work. I was just wondering out of curiosity if there was any way to delay a handler
You could do that with setInterval too. In pseudo code:
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
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.