I was hoping for some guidelines on the general best practice for storing data from an XML document. When all is said and done, my whole flash site will be powered by XML, so I want to make sure it is organized properly. Usually what I do is parse the XML, and store all the different sets of data in arrays, but I’m sure there’s a better way to do it. I’m no expert though, so I need something fairly straightforward. Here’s my initial setup:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("xml/presentation.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
XML.ignoreWhitespace = true;
myXML = new XML(e.target.data);
for (var i:int = 0; i<myXML.*.length(); i++){
trace("Node is " + (i+1) + ", title is " + myXML.projects.project[i].title);
};
}
Thanks!
imho this is right,
but you should create a xmllist for processing data faster and properly