XML Handling Question

Hey All,

I’ve kind of stumped myself on something. it’s been a while since i’ve dealt with XML. So here is what I’m trying to do. I have three movieclips at the top of my page which contain text fields. When the swf first loads, the xml will load and fill all three of those movie clips with the appropriate <name> data from the xml. When one of the names are clicked, the corresponding fields needs to populate data from the xml (name, title, description, image). When another movieclip is clicked, that previous data needs to be removed, then filled with the new data. I’ve attached my fla and xml file incase none of that makes sense, but here is my code so far:



import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;

//Alignement
var xPlacement:Number;
var yPlacement:Number;
var distance:Number;
var xmlLength:int;

//XML
var xmlData:XML = new XML();
var xml_url:String = "testXML.xml";
var xmlUrlRequest:URLRequest = new URLRequest(xml_url);
var xmlLoader:URLLoader = new URLLoader(xmlUrlRequest);

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(e:Event):void {

	xmlData = XML(xmlLoader.data);
	xmlLength = xmlData.test.length();
	
	for (var i:int = 0; i < xmlLength; i++) {
		
		var fName:String = xmlData.test.name*.toString();
		var fTitle:String = xmlData.test.title*.toString();	
		var fDescrip:String = xmlData.test.descrip*.toString();	
		var fPicture:String = xmlData.test.image*.toString();
	}
}



Any help would be appreciated.