How to arrange images with coordinates given from xml?

kyyang

New Member
Good day, I have a question. I need to use loop to arrange loaded images from XML. How should I load in function loadData images with it's coordinates(x,y) and description with textfields ?? Here is my code:\[code\]var xmlList:XMLList;var urlLoader:URLLoader;function Main():void { urlLoader = new URLLoader(); urlLoader.load(new URLRequest("images.xml")); urlLoader.addEventListener(Event.COMPLETE, loadData); }function loadData(e:Event):void {xml = new XML(urlLoader.data);xmlList = xml.image;for (var i:uint = 0; i < xmlList.length(); i ++ ) { }}\[/code\]Here is my XML:\[code\]<images><image> <title>First Picture</title> <file>images/pic1.jpg</file> <x>180</x> <url></url> <y>50</y> </image><image> <title>Second Picture</title> <file>images/pic2.jpg</file> <x>100</x> <y>100</y> <url></url> </image>\[/code\]Thanks a lot!
 
Back
Top