# Loading images through xml problem?

**URL:** <https://forum.kirupa.com/t/loading-images-through-xml-problem/90153>\
**Category:** flash\
**Created:** [May 15, 2005, 6:42am UTC](https://forum.kirupa.com/t/loading-images-through-xml-problem/90153 "2005-05-15T06:42:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inept](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@Inept](https://forum.kirupa.com/u/Inept)\
**Post date:** [May 15, 2005, 6:42am UTC](https://forum.kirupa.com/t/loading-images-through-xml-problem/90153/1 "2005-05-15T06:42:04Z")

</div>

I’m having a problem being able to display an external image using xml, I have it set up so that once it loads it is put into an emtpy mc on the stage. I’ve been looking at the xml photogallery tutorial and I can’t see anything wrong?

The actionscript is this:

```auto
function loadXML(loaded) { 
if (loaded) { 
bgImg = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
background_img.loadMovie(bgImg, 1);
} else { 
trace("file not loaded!"); 
} 
} 
xmlData = new XML(); 
xmlData.ignoreWhite = true; 
xmlData.onLoad = loadXML; 
xmlData.load("background.xml");

```

And the xml looks like this:

```auto
 <?xml version="1.0"?>
<background>
<image>background.jpg</image>
</background> 

```

The problem is that I keep getting an output of “Error opening URL” it then shows the absolute directory to where my file is saved and at the end says undefined.

Cheers,  
Inept
