# \[fmx\] new to xml, but don't think thats the problem

**URL:** <https://forum.kirupa.com/t/fmx-new-to-xml-but-dont-think-thats-the-problem/30400>\
**Category:** flash\
**Created:** [September 8, 2003, 10:55am UTC](https://forum.kirupa.com/t/fmx-new-to-xml-but-dont-think-thats-the-problem/30400 "2003-09-08T10:55:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bikkies4u](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@bikkies4u](https://forum.kirupa.com/u/bikkies4u)\
**Post date:** [September 8, 2003, 10:55am UTC](https://forum.kirupa.com/t/fmx-new-to-xml-but-dont-think-thats-the-problem/30400/1 "2003-09-08T10:55:47Z")

</div>

Below is some dodgy AS, in that its nots working… you can see from the trace that the header variable, does have a value, but it won’t assign to the txtlabel for my textbox. Any ideas anybody.

```auto

defX = 0;
defY = 0;// distance _y btw menu items
	myformat = new TextFormat();
	myformat.color = 0x000000;
	myformat.font = "FFF Harmony";
	myformat.align="left";
	myformat.size=8;
	myformat.bold= false;
// ***************************************************
// Contruct myButton object
myButton = function () {
	this.onLoad = function() {
	this.label_txt.embedFonts = true;
	this.label_txt.setTextFormat(myformat);
	
};
	this.onRollOver = function() {
	this.label_txt.textColor = 0xFF0000;
	 
};
	this.onRollOut = function() {
	this.label_txt.textColor = 0x000000;
};
	this.onRelease = function() {
	myString=new String(this._name);
	getURL(myString.toLowerCase()+".html");
};
	this.txtSet = function(what) {
	this.label_txt.text = what;
	defX +=(this.label_txt.textWidth + 10);
	if (_global.devX < defX) _global.defX = defX;
};
	this.posMe = function(xVal, yVal) {
	this._x = xVal;
	this._y = yVal;
};

}
// register myButton as a movieclip
myButton.prototype = new MovieClip();
//assosiate the object with 'but' in library 
Object.registerClass("but", myButton);
// **********************************************

	
var array = new Array ();
var xml = new XML ();
xml.onLoad = function ()
{
	var header, link;
	for (var i = 0; i < this.firstChild.childNodes.length; i++)
	{

			if (this.firstChild.childNodes*.nodeName != null)
			{				
				header = this.firstChild.childNodes*.attributes.header;
			}
			for (var j = 0; j < this.firstChild.childNodes*.childNodes.length; j++)
			{
				if (this.firstChild.childNodes*.childNodes[j].nodeName == "link")
				{
					
					link = this.firstChild.childNodes*.childNodes[j].firstChild.nodeValue;
				}
			}
			//array.push (new struct (header, link));
			this.attachMovie("but", "button"+i, 109+i);
			// position menus and set text
			this["button"+i].posMe(defX, defY);
			this["button"+i].txtSet("chris");
			trace("header:"+header+"button:"+"button"+i);
			array.push(header);
	}

};

xml.load ("dbase.xml");

stop();

```
