# Xml menu

**URL:** <https://forum.kirupa.com/t/xml-menu/175857>\
**Category:** Uncategorized\
**Created:** [January 18, 2006, 12:20pm UTC](https://forum.kirupa.com/t/xml-menu/175857 "2006-01-18T12:20:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)\
**Post date:** [January 18, 2006, 12:20pm UTC](https://forum.kirupa.com/t/xml-menu/175857/1 "2006-01-18T12:20:03Z")

</div>

Hi,

i am trying to build a xml menu. my xml scheme looks like this:

```php
<images>    
    <pic>
        <cat></cat>
        <image></image>
        <titlename></titlename>
        <description></description>
    </pic>

</images>

```

i am trying to use cat to sort the menu into columns. for example if cat == web \_x = 300.

heres my code

```php
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		cat = [];
		image = [];
		titlename = [];
		description = [];
		/*bodytext = [];*/
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			cat* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
			image* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
			titlename* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
			description* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
			trace(cat*);
			main_menu.pbtn.duplicateMovieClip("pbtn"+i, i);
		}
		for (var i = 0; i<image.length; i++) {
			item = _root.attachMovie("itemClip", "itemClip"+i, i);
			item._x = 0;
			item._y = 20*i;
			item.itemLabel.text = titlename*;
			item.myUrl = image*;
			item.onRelease = function() {
				getURL(this.myUrl, "_blank");
			};
		}
		firstImage();
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

```

many thanks,  
G
