Flash Video Player with thumbs
i
Hi,
I would like to know how to reference something in my xml. Im adding thumbnails and would like to know how to get the file name in from the xml using the attributes method. The videos are loaded in an list component I want to use "trace" to get an property or attibute from the xml file. I tried trace(videos.attributes.thumb+"thumbnail"); but it didnt work. The XML file is also posted
Actionscript 2.0
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
videoList.addItem(videos.attributes.desc,videos.attributes.url,videos.attributes.thumb);
}
//play 1st video
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
//would like to reference something in the XML File with the thumb attribute
trace (videoList+" thumbnails");
};
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
};
videoList.addEventListener("change",vidList);
vlist.load("videos.xml");
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="rsflvs/sn.flv" desc="Sn.flv" thumb="1.jpg"/>
<video url="rsflvs/sn2.flv" desc="Sn2.flv" thumb="2.jpg"/>
</videos>