# Stay on frame for 5 seconds, then break not working

**URL:** <https://forum.kirupa.com/t/stay-on-frame-for-5-seconds-then-break-not-working/192071>\
**Category:** flash\
**Created:** [June 25, 2006, 8:44pm UTC](https://forum.kirupa.com/t/stay-on-frame-for-5-seconds-then-break-not-working/192071 "2006-06-25T20:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![REEF](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@REEF](https://forum.kirupa.com/u/REEF)\
**Post date:** [June 25, 2006, 8:44pm UTC](https://forum.kirupa.com/t/stay-on-frame-for-5-seconds-then-break-not-working/192071/1 "2006-06-25T20:44:50Z")

</div>

I’ve been running a function that holds a frame for 5 seconds, then continues to the next desired frame. Heres my code:

```auto
stop(); // stops at the frame
seconds = 5;
function frameTime() {
	seconds -= 1; // decrements seconds
	if (seconds<=0) {
		gotoAndPlay("whateverFrame");
	}
}
setInterval(frameTime, 1000); // run every second

```

The code moves to “whateverFrame” I need it to, however every second it keeps going back to “whateverFrame” and doesnt continue to play the rest of the movie. Is there anyway to stop this function after seconds\<=0 and break it so it doesnt keep happening even AFTER the frame is changed?
