# How to Break a looping slideshow?

**URL:** https://forum.kirupa.com/t/how-to-break-a-looping-slideshow/236582
**Category:** Uncategorized
**Created:** [August 22, 2007, 12:38am UTC](https://forum.kirupa.com/t/how-to-break-a-looping-slideshow/236582 "2007-08-22T00:38:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LeDisciple](https://avatars.discourse-cdn.com/v4/letter/l/6bbea6/32.png) [@LeDisciple](https://forum.kirupa.com/u/LeDisciple)
#### Post date: [August 22, 2007, 12:38am UTC](https://forum.kirupa.com/t/how-to-break-a-looping-slideshow/236582/1 "2007-08-22T00:38:13Z")

</div>

Hi people, here i have an XML slideshow, my client want to add or remove himself pictures by XML. This slideshow loop after the last image but I want the slideshow to Break the loop when reaching XML’s lastNode or LastChild and then gotoAndPlay a frame. I know it’s in this script, can someone figure it out?

import flash.display.Sprite;  
import flash.net.NetConnection;  
import flash.net.NetStream;  
import flash.media.Video;  
import flash.text.TextField;  
import flash.text.TextFormat;  
import flash.events.Event;  
import flash.events.TimerEvent;  
import flash.events.NetStatusEvent;  
import flash.utils._;  
import flash.geom._;  
import flash.display._;  
import flash.xml.XMLDocument;  
import flash.xml.XMLNode;  
import flash.xml.XMLNodeType;  
import com.flash9.xml._;  
import com.flash9.load._;  
import com.flash9.engines._;  
// references aux classes  
var slideshow:SlideShow;  
//load xml  
var info:ImagesXML = new ImagesXML();  
info.addEventListener(Event.COMPLETE, onXML);  
info.load(“banner.xml”);  
function onXML(event:Event):void {  
container.x=54;  
container.y=32;  
// load images  
for (var i:uint=0; i\<info.images.length(); i++) {  
this[“image”+i] = new LoadImage(container);  
this[“image” + i].load( info.images\* );  
}  
//slideshow  
slideshow = new SlideShow(container);  
slideshow.start();  
}

and banner.XML file:  
\<?xml version=“1.0” encoding=“iso-8859-1”?\>  
\<banner time=“5.5”\>

```
&lt;pictures&gt;
    &lt;image&gt;stretch1.jpg&lt;/image&gt;
    &lt;image&gt;stretch2.jpg&lt;/image&gt;
    &lt;image&gt;stretch3.jpg&lt;/image&gt;
    &lt;image&gt;stretch4.jpg&lt;/image&gt;
    &lt;image&gt;stretch5.jpg&lt;/image&gt;
&lt;/pictures&gt;

```

\</banner\>
