1.

Solve : Flash and xml?

Answer»

i have this CODE

Code: [Select]var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();


xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

xmlLoader.load(new URLRequest("mani-admin.xml"));


function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks(xmlData);
}

function ParseBooks(bookInput:XML):void {
trace("XML Output");
trace("------------------------");

var authorList:XMLList = bookInput.item.text();
mani.text = "";
for each (var authorElement:XML in authorList) {
trace(authorElement);

mani.text += authorElement + "\n";
}
}
and it loads an xml file into flash and PRODUCES the results on screen

i am slightly confused as to how i would adapt it for two more xml files

any suggestions would be great i am using AS3 btw and the two other xml files i want to include are called sourcemod.xml and match-configs.xml

the xml used in that code is

Code: [Select]<?xml version="1.0" ENCODING="UTF-8" ?>
<downloads>
<item>New Text Document - Copy (2) - Copy.txt</item>
<item>New Text Document - Copy (2).txt</item>
<item>New Text Document - Copy (3).txt</item>
<item>New Text Document - Copy - Copy.txt</item>
<item>New Text Document - Copy.txt</item>
<item>New Text Document.txt</item>
</downloads>

ignore the fact its multiple text files as i am only testing the script



Discussion

No Comment Found