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:
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:
<?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>