# XML loadMovie question

**URL:** <https://forum.kirupa.com/t/xml-loadmovie-question/250658>\
**Category:** Uncategorized\
**Created:** [January 31, 2008, 2:41pm UTC](https://forum.kirupa.com/t/xml-loadmovie-question/250658 "2008-01-31T14:41:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![worked](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@worked](https://forum.kirupa.com/u/worked)\
**Post date:** [January 31, 2008, 2:41pm UTC](https://forum.kirupa.com/t/xml-loadmovie-question/250658/1 "2008-01-31T14:41:00Z")

</div>

I have a very simple XML driven movie…

It loads 4 swfs to a movieclip on the main timeline incrementally with previous and next buttons (nothing fantasy). But what if I wanted the option to skip ahead swfs with an ordered list, i.e. 1\_btn, 2\_btn, 3\_btn and 4\_btn while maintaining the previous and next btns? What code would I need to add?

Thanks, any help is appreciated!

**ACTION SCRIPT:**

```auto
var x:XML = new XML();
x.ignoreWhite = true;

var urls:Array = new Array();
var captions:Array = new Array();
var whoIsOn:Number;

x.onLoad = function(success) {
    var photos:Array = this.firstChild.childNodes;
    for(i=0;i<photos.length;i++) {
        urls.push(photos*.attributes.url);
        captions.push(photos*.attributes.caption);
    }
    holder.loadMovie(urls[0]);
    caption.text = captions[0];
    whoIsOn = 0;
}

x.load("pages.xml");

previous.onRelease = function() {
    if(whoIsOn > 0) {
        whoIsOn--;
        holder.loadMovie(urls[whoIsOn]);
        caption.text = captions[whoIsOn];
    }
}

next.onRelease = function() {
    if(whoIsOn < urls.length-1) {
        whoIsOn++;
        holder.loadMovie(urls[whoIsOn]);
        caption.text = captions[whoIsOn];
    }
}

```

**XML:**

```auto
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
<page url="1.swf" caption="Page 1" />
<page url="2.swf" caption="Page 2" />
<page url="3.swf" caption="Page 3" />
<page url="4.swf" caption="Page 4" />
</slideshow>

```
