# Create Photo Slideshow setInterval

**URL:** <https://forum.kirupa.com/t/create-photo-slideshow-setinterval/205097>\
**Category:** flash\
**Created:** [October 26, 2006, 4:44am UTC](https://forum.kirupa.com/t/create-photo-slideshow-setinterval/205097 "2006-10-26T04:44:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bangelo](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@bangelo](https://forum.kirupa.com/u/bangelo)\
**Post date:** [October 26, 2006, 4:44am UTC](https://forum.kirupa.com/t/create-photo-slideshow-setinterval/205097/1 "2006-10-26T04:44:34Z")

</div>

As a complete newbie to action scripts & flash for that matter, I have completed the slideshow tutorial and wanted a way to have it automatically move to the next image without having to use the arrow keys.

I’m not sure of the correct way to replace this code:

```auto
this.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
        this.changePhoto(-1);
    } else if (Key.getCode() == Key.RIGHT) {
        this.changePhoto(1);
    }
};
Key.addListener(this);

```
