# XML and ActionScript

**URL:** <https://forum.kirupa.com/t/xml-and-actionscript/168956>\
**Category:** flash\
**Created:** [November 11, 2005, 3:20pm UTC](https://forum.kirupa.com/t/xml-and-actionscript/168956 "2005-11-11T15:20:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VersusMG](https://avatars.discourse-cdn.com/v4/letter/v/898d66/32.png) [@VersusMG](https://forum.kirupa.com/u/VersusMG)\
**Post date:** [November 11, 2005, 3:20pm UTC](https://forum.kirupa.com/t/xml-and-actionscript/168956/1 "2005-11-11T15:20:11Z")

</div>

```auto
stop();
//
//
path = this;
function loadXML(success) {
	if (success) {
		xmlNode = this.firstChild.childNodes;
		for (i=0; i<xmlNode.length; i++) {
			var img = xmlNode*.childNodes[0].nodeValue;//Math.random();
			container.loadMovie(img);
		}
	}
}
var news_xml = new XML();
news_xml.ignoreWhite = true;
news_xml.onLoad = loadXML;
news_xml.load("headers.xml");

```

I it to randomly pick one of the childNodes and display it in the container. I tried to place in a Math.random(); but I wasn’t sure where to put it.
