Link to home
Start Free TrialLog in
Avatar of ebhnewbie
ebhnewbie

asked on

How do you create a slideshow (with forward and next buttons and dynamic captions using swf files?

Hi- I am pretty new at this xml / as stuff but I am eager to learn and can learn by examples.

So here is my problem, I found a great xml slideshow with dynamic captions. Its exactly what I want but I dont want to load photos I need to load external swfs.

Does anyone know how to create a XML slideshow like this but instead of loading photos it would load swfs?

All help provided is very appreciated!
Thanks
XML FILE:
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
<photo url="lost1.jpg" caption="BLAH BLAH BLAH." />
<photo url="lost2.jpg" caption="BLAH BLAH BLAH." />
<photo url="lost3.jpg" caption="BLAH BLAH BLAH." />
<photo url="lost4.jpg" caption="BLAH BLAH BLAH." />
<photo url="lost5.jpg" caption="BLAH BLAH BLAH." />
</slideshow>
 
 
ACTIONSCRIPT FILE:
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[i].attributes.url);
		captions.push(photos[i].attributes.caption);
	}
	holder.loadMovie(urls[0]);
	caption.text = captions[0];
	whoIsOn = 0;
}
 
x.load("lost.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];
	}
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ebhnewbie
ebhnewbie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial