# Dynamic XML Menu

**URL:** https://forum.kirupa.com/t/dynamic-xml-menu/219620
**Category:** flash
**Created:** [March 18, 2007, 7:30pm UTC](https://forum.kirupa.com/t/dynamic-xml-menu/219620 "2007-03-18T19:30:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![boondocksaint2k](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/boondocksaint2k/32/3453_2.png) [@boondocksaint2k](https://forum.kirupa.com/u/boondocksaint2k)
#### Post date: [March 18, 2007, 7:30pm UTC](https://forum.kirupa.com/t/dynamic-xml-menu/219620/1 "2007-03-18T19:30:29Z")

</div>

I have a movie clip in my library linked as aboutUsMenuBtn. And I as get the childNodes.nodeName from the XML file, I want them to be assigned to a dynamic text field “btn\_txt” inside of the aboutUsMenuBtn. With each node, a button is going to be attached to the aboutUs stage (I’m working using a Flash Form Application).

aboutUs.xml -

```auto
<aboutUs>
	<resume>
		<item>
			<title>title</title>
			<content>content</content>
		</item>
	</resume>
	<prices>
		<item>
			<title>title</title>
			<content>content</content>
		</item>
	</prices>
</aboutUs>

```

So basically it’d be two dynamically attached movie clips (“buttons”) and one would read “resume” and the other one “prices”.

ActionScript inside the onLoad for the xml -

```auto
var xPos = 42.0;
var yPos = 175.0;
var yPosIncrement = 33.0;
var xmlNode = this.firstChild.childNodes;
for (var i = 0; i<xmlNode.length; i++) {
	var uniqueID:String = "aboutUsMenuBtn"+i.toString();
	with (_parent) {
		aboutUs.attachMovie("aboutUsMenuBtn", uniqueID, _root.getNextHighestDepth());
		with (aboutUs[uniqueID]) {
			_x = xPos;
			_y = yPos + yPosIncrement * i;
			btn_txt.text = xmlNode*.nodeName;
		}
	}
}

```

Now, I think that it would work, but it doesn’t. It just displays one empty button, no nodeName inside of it.

I don’t know how to get it to work right; would somebody please help me? I can clarify if I need to.
