Hi,
I need help.
I am making a video player, and I don't ussually use XML but I wanted it to be a little easier to edit than pervious ones i've made.
I've been using the book "Flash Video for Professionals" by Lisa Larson and Renee Costantini. instead of spending more time on this I thought I'd post it and hope for the best!
Everything was perfect, but now my boss wants me to add this drawer that comes out with a text description about each video title.
basically, since i'm already done, I just want to add in an element to my XML and not have to do it a different way.
THE PROBLEM
The way I have my as and xml set up, it loads the data for "longdesc" just not in conjunction with the "desc" like I want it too.
Here is some of my code, the part that loads the xml
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(new URLRequest("playlistXML.xml"));
function xmlLoaded(event:Event):void {
var playlistXML:XML = new XML(event.target.data);
var item:XML;
for each (item in playlistXML.videoname) {
trace("item: "+item.attribute("flvurl").toXMLString());
trace("item:"+item.attribute("longdesc").toXMLStri ng());
this.selections.selection_desc.text = (item.attribute("longdesc").toXMLString());
myList.addItem({label:item.attribute("desc").toXML String(),
data:item.attribute("flvurl").toXMLString()});
}
//select the first video
myList.selectedIndex = 0;
//And automatically play it
myFLVPlybk.play(myList.selectedItem.data);
}
function listListener(event:Event) {
myFLVPlybk.play(event.target.selectedItem.data);
}
myList.addEventListener(Event.CHANGE, listListener);
MY XML FILE:
Thank you in advance!!!<?xml version="1.0" encoding="iso-8859-1"?>
<playlist>
<videoname
flvurl="videos/one.flv"
desc="Popeye for President President "
longdesc="111Sed ut perspiciatis unde omnis iste natus error sit "/>
<videoname
flvurl="videos/two.flv"
desc="Vote for Popeye"
longdesc="222Sed ut perspiciatis unde omnis iste natus error sit " />
<videoname
flvurl="videos/three.flv"
desc="video test in list "
longdesc="333 ut perspiciatis unde omnis iste natus error sit " />
<videoname
flvurl="videos/four.flv"
desc="Vote for Popeye video four"
longdesc="444 ut perspiciatis unde omnis iste natus error sit "/>
</playlist>