PDA

View Full Version : Help with loading xml data


dan2684
11-20-2009, 11:34 PM
Hi all,

I'm loading data into my flash movie from an xml file like this:



var queryStrings = this.loaderInfo.parameters;
var gallery = queryStrings.galleryName;

var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, loadXML, false, 0, true);
xmlLoader.load(xmlURL);

function loadXML(evt:Event):void{

var xmlData:XML = new XML(evt.target.data);
images = xmlData.personal.image;
}

The problem is; the part that says "personal" is supposed to be dynamic depending on the query string. So effectively, it's meant to be xmlData.gallery.image - but that doesn't work for obvious reasons!

Does anyone know how I would go about doing that?

Thanks in advance,

Dan

meshy
11-21-2009, 11:13 AM
xmlData.(personal == gallery)

You can dump the xmlData with trace() to see if youre getting the xml you need.

http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_08.html