# Looping slideshow

**URL:** <https://forum.kirupa.com/t/looping-slideshow/214395>\
**Category:** Uncategorized\
**Created:** [January 28, 2007, 5:10pm UTC](https://forum.kirupa.com/t/looping-slideshow/214395 "2007-01-28T17:10:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![masskontroll](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@masskontroll](https://forum.kirupa.com/u/masskontroll)\
**Post date:** [January 28, 2007, 5:10pm UTC](https://forum.kirupa.com/t/looping-slideshow/214395/1 "2007-01-28T17:10:47Z")

</div>

Hi there, I’ve made a sequence of frames containing 1 image each. I’ve attached this script:

stop();

var myInterval:Number;

myInterval = setInterval (this,“nextFrame”,1000);

…to make the playhead move 1 frame after every second. Now I’d like it to loop, so go back to the first frame after reaching the last. But I can’d figure out which script to use: “gotoAndPlay” just makes the playhead go berserk. Any ideas? Also: is there a script with which you can target the looping mc and get it to stop after pressing a button, and continue at the next frame after pressing another? THANX!
