setInterval

Hi,

I’m attempting to advance a movie by time not by frame rate so, on frame 34 I have

function playNext() {
	gotoAndPlay("scene1");
	clearInterval(timerInterval);
}
timerInterval = setInterval(playNext, 5000);

with a scene1 label at frame 45, but the movie does not stop at 34, it continues to frame 45 plays to 55, where their is a

stop()

action. At frame 55 it loops back to 45, playing once again to 55 then stops.

What Am I missing?

I’m having setInterval issues as well. Just trying to pause the movie…but after a while it starts to speed up and then is not functional at all.

function wait() {
	stop();
	var myInterval = setInterval(function () {
		play();
		clearInterval(myInterval);
	}, 5*1000);
	// stop for 5 seconds 
}

on the frame I want to pause


wait();
stop();

Hi,

I solved my issued by putting a stop action on the frame after the set interval function. All is well, but is this this the most efficient method?

Have you put a stop() in frame 34 as well?