I have this actionscript so far:
var xmlLoader:URLLoader = new URLLoader(); var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("nav.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data); ParseBooks(xmlData);
}
function ParseBooks(bookInput:XML):void {
trace("XML Output"); trace("------------------------"); trace(bookInput); trace(bookInput.project);
}
This loads the xml, assigns it to bookInput and traces it, but when I try and trace bookInput.project, or bookInput.button, or anything besides bookInput, no data is returned, does anyone know why this is?
XML;
<button label="test1">
<project path="http://www.google.com">
</project>
</button>
<button label="test2">
<project path="projects/drawing/DrawingApp.swf">
</project>
</button>
<button label="test3">
<project path="projects/text/DrawingApp.swf">
</project>
</button>
</buttons>