# Slideshow Autoscroll

**URL:** <https://forum.kirupa.com/t/slideshow-autoscroll/244660>\
**Category:** flash\
**Created:** [November 20, 2007, 5:13pm UTC](https://forum.kirupa.com/t/slideshow-autoscroll/244660 "2007-11-20T17:13:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin\_VH](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@Dustin\_VH](https://forum.kirupa.com/u/Dustin_VH)\
**Post date:** [November 20, 2007, 5:13pm UTC](https://forum.kirupa.com/t/slideshow-autoscroll/244660/1 "2007-11-20T17:13:41Z")

</div>

I am new to AS 3 and am having trouble with a slideshow I have built from another tutorial. The slideshow works perfectly except that I would like it to automatically go from one picture to the other with a delay. Currently the user has to click a Next button or select the item from a drop downlist to view. Any help would greatly be appreciate.

MY CODE

import fl.data.DataProvider;  
// Pull in image information from XML  
var xml:XML = new XML();  
var xmlLoader:URLLoader = new URLLoader();  
xmlLoader.load(new URLRequest(“slideshow.xml”));  
xmlLoader.addEventListener(  
Event.COMPLETE,  
function(evt:Event):void {  
xml = XML(evt.target.data);  
images.dataProvider = new DataProvider(xml);  
changePicture(0);  
}  
);  
// Keep track of current image  
var currentImage:Number = 0;  
// Picture changing function  
function changePicture(pict:Number):void {  
pb.visible = true;  
partNumber.text = xml.slide[pict].@partNumber;  
description.text = xml.slide[pict].@description;  
price.text = xml.slide[pict].@price;  
loader.load(new URLRequest(xml.slide[pict].@data));  
}  
// Wire up progress bar  
pb.source = loader;  
// Handle progress bar loading completion  
pb.addEventListener(  
Event.COMPLETE,  
function(evt:Event):void {  
pb.visible = false;  
}  
)  
// Handle combo box changes  
images.addEventListener(  
Event.CHANGE,  
function(evt:Event):void {  
changePicture(images.selectedIndex);  
}  
);  
// Handle button clicks  
next.addEventListener(  
MouseEvent.CLICK,  
function(evt:MouseEvent):void {  
currentImage++;  
if (currentImage == xml.slide.length()) {  
currentImage = 0;  
}  
images.selectedIndex = currentImage;  
changePicture(currentImage);  
}  
);
