Pause function

I’ve got this pause function, but I’m unable to clearInterval, I’ve tried everything. I’d like to know if someone had a pause function that was a little simpilar than the one below.

//SET PAUSE FUNCTION
//=======================================
function pause(t, v)
{
t.interval = setInterval(unPause, v, t);
t.stop();
}

function unPause(t)
{
	clearInterval(t.interval);
	t.play();
}

// PAUSE THIS MOVIE
//=================================
pause(this, 3000)

are you just trying to make a movie clip stop when you press a button, then unstop when you press it again? or do you want it to be on a timer?

:sigh:

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=30002

I’d like for it to pause when it hits a certain frame, then continue after it’s ran through the “pause”.

The above code works fine for one pass through.

Problem is, if I click buttons to jump to a new section, the interval won’t clear. I’ve tried putting the clearInterval() everywhere… on the buttons, in the same frames, other frames, beginning of movies, etc. Nothing works.

I just figured I’d try another pause method and see if I could get it to work.

Anyways… just “pause on the frame”.

I found this one:

========================================

this.stop();
pause = function () {
play();
clearInterval(stall);
}
stall = setInterval(pause, 10000);

=========================================

Would anyone mind explaining to me how it works?

Thanks!!

On whatever frame you place that script on, it will pause it for 10 seconds.

10000 = 10 seconds

I think I understand…

Thanks for all the help… I think I got this figured out!

OK OK… everything is working good with the above pause function, but I can’t get it to cancel. I’m putting

clearInterval(name);

in the frame right after the pause, but it’s not canceling the pause. Do I need to add something to it?

Lost…

Isn’t it suppose to be:

clearInterval(stall);

Since that’s what it was called in the pause script above?

Nevemind guys… I was smoking crack and putting the wrong name in the

clearInterval(name);

Right… I was putting:

clearInterval (stall);

but for some reason it wasent’ clearing, so I put,

clearInterval (pause);

which refers to the function… and it worked somehow… oh well, as long as it works.

Sorry to screw this thread up… but, actually neither one of those clearInterval() are working.

They actually don’t stop working until my movie is loaded into a blank MC on the _root.

Would that have anything to do with it?