# Load image from XML into flash

**URL:** <https://forum.kirupa.com/t/load-image-from-xml-into-flash/185507>\
**Category:** flash\
**Created:** [April 13, 2006, 7:55pm UTC](https://forum.kirupa.com/t/load-image-from-xml-into-flash/185507 "2006-04-13T19:55:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)\
**Post date:** [April 13, 2006, 7:55pm UTC](https://forum.kirupa.com/t/load-image-from-xml-into-flash/185507/1 "2006-04-13T19:55:14Z")

</div>

I have a very simple question: How do I load one image from an XML file into a flash movie. Thats it, nothing fancy, just one image. Here is my XML

```auto
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>

    <news>
        <pic>http://www.mc2.com.ky/beta/cisc/images/navbar/spinnakers.jpg</pic>
    </news>

</images>

```

I have a basic flash movie with an empty movie clip on the stage labeled picture.

---

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [April 14, 2006, 2:01am UTC](https://forum.kirupa.com/t/load-image-from-xml-into-flash/185507/2 "2006-04-14T02:01:33Z")

</div>

I’m whipping this out without really scrutinizing your xml. you may have to fiddle with the firstChild.firstChild etc. part to get it right but you should get the idea from this. also, check out senocular’s 40 page tute here on Kirupa. Hope this helps!

```auto

stop();
myXML=new XML();
myXML.onLoad=function(success){
if(success){
imageToLoad=myXML.firstChild.firstChild.firstChild.nodeValue;
picture.loadMovie(imageToLoad);
}
}
myXML.load("myXMLfile.xml");

```
