# Need help loading XML

**URL:** <https://forum.kirupa.com/t/need-help-loading-xml/307210>\
**Category:** Uncategorized\
**Created:** [March 30, 2010, 7:30pm UTC](https://forum.kirupa.com/t/need-help-loading-xml/307210 "2010-03-30T19:30:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![redenvy](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@redenvy](https://forum.kirupa.com/u/redenvy)\
**Post date:** [March 30, 2010, 7:30pm UTC](https://forum.kirupa.com/t/need-help-loading-xml/307210/1 "2010-03-30T19:30:46Z")

</div>

IM trying to load an XML file with images and their descriptions and titles however when i attempt to trace the length of the XMLList, it displays as empty. heres the code.

```auto

function ImageRotator(xmlPath:String = "photo_gallery.xml"):void
 {
   loadXML(xmlPath);
 }
function loadXML(file:String):void
 {
   var xmlLoader:URLLoader = new URLLoader();
   var [url:URLRequest](http://www.kirupa.com/forum/URLRequest) = new URLRequest(file);
   xmlLoader.load(url);
   trace("xml loaded")
   xml = new XML(xmlLoader.data);
   var galleryElements:XMLList = xml.image;
   trace(galleryElements.length());
   
   
   //loadImages();
   
   
 }
 
 

```
