# \_xscale loader with setInterval

**URL:** <https://forum.kirupa.com/t/-xscale-loader-with-setinterval/305459>\
**Category:** flash\
**Created:** [February 25, 2010, 7:14pm UTC](https://forum.kirupa.com/t/-xscale-loader-with-setinterval/305459 "2010-02-25T19:14:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tompa07](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@Tompa07](https://forum.kirupa.com/u/Tompa07)\
**Post date:** [February 25, 2010, 7:14pm UTC](https://forum.kirupa.com/t/-xscale-loader-with-setinterval/305459/1 "2010-02-25T19:14:35Z")

</div>

[FONT=Arial][COLOR=Black][SIZE=2]Hi,

I’ve r[/SIZE][/COLOR][/FONT][FONT=Arial][COLOR=Black][SIZE=2]ead the [/SIZE][/COLOR][/FONT][FONT=Arial][COLOR=Black][SIZE=2][_ **Photo Slideshow** _ and the\*\*\* [URL=“http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery.htm”]Photo Gallery Using XML and Flash](http://www.kirupa.com/developer/mx2004/xml_slideshow.htm)\*\*\* tutorials from Kirupa and I’ve modified it a little bit to suite my website. Mostly layout changes.

What I want to do is for the slideshow() function, with the setInterval, is to have a “time bar” that shows the time of that setInterval function. Just like a preloader.

I have a movieclip named \*\*time\_left \*\*and in that movieclip I have a border and also another movieclip called **whats\_left**. The idea is to use \_xscale and scale the \*\*whats\_left \*\*moviclip.

Here’s the [/SIZE][/COLOR][/FONT][FONT=Arial][COLOR=Black][SIZE=2]actionscript for the[/SIZE][/COLOR][/FONT][FONT=Arial][COLOR=Black][SIZE=2] slideshow() function  
[/SIZE][/COLOR][/FONT][COLOR=Black]

```auto

function slideshow() {
    myInterval = setInterval(pause_slideshow, delay);
    function pause_slideshow() {
        if(p == (total-1)) {
            p = 0;
            firstImage();
        }
        else {
            nextImage();
        }
    }
} 

```

If you know the tutorials I’ve read and wonder where my clearInterval is, it’s in my prevImage, nextImage and firstImage functions as I use the previous- and next-buttons to give my users the ability to skip the timer and go straight to the next/previous image.

Thanks in advance,[/COLOR] [COLOR=Black]  
Tom[/COLOR]
