# Loading simple image to movieclip with xml

**URL:** <https://forum.kirupa.com/t/loading-simple-image-to-movieclip-with-xml/158403>\
**Category:** flash\
**Created:** [August 9, 2005, 3:12pm UTC](https://forum.kirupa.com/t/loading-simple-image-to-movieclip-with-xml/158403 "2005-08-09T15:12:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/wayne/32/16501_2.png) [@Wayne](https://forum.kirupa.com/u/Wayne)\
**Post date:** [August 9, 2005, 3:12pm UTC](https://forum.kirupa.com/t/loading-simple-image-to-movieclip-with-xml/158403/1 "2005-08-09T15:12:15Z")

</div>

Okay I have searched the forum for loading an simple image into flash using xml, and some have not been answered.  
I simply got a jpg image and want to load it in a movie clip called (pic)

ActionScript code:\>\>\>

```auto
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
		}
		loadImage();
	} else {
		trace("file not loaded!");
	}
}
//Load Image
function loadImage() {
	if (loaded == filesize) {
		pic._alpha = 0;
		pic.loadMovie(image[0], 1);
	}
}
//Load your xml file to be showed up 
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.load("images.xml");

```

\<\<\<

and xml code file images.xml

```auto
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
    <pic>
        <image>50.jpg</image>
    </pic>
</images>

```
