# XML in ActionScript 2 class

**URL:** https://forum.kirupa.com/t/xml-in-actionscript-2-class/38651
**Category:** Uncategorized
**Created:** [December 27, 2003, 5:32pm UTC](https://forum.kirupa.com/t/xml-in-actionscript-2-class/38651 "2003-12-27T17:32:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dene22](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@dene22](https://forum.kirupa.com/u/dene22)
#### Post date: [December 27, 2003, 5:32pm UTC](https://forum.kirupa.com/t/xml-in-actionscript-2-class/38651/1 "2003-12-27T17:32:34Z")

</div>

I’ve just converted some code to an ActionScript 2 class, and now the XML doesn’t work.

```auto

class Menus.DropSlideMenu
{
	var _myXML;

	public function DropSlideMenu()
	{
		init();
	}
	function init()
	{
		_myXML = new XML();
		_myXML.ignoreWhite = true;
		_myXML.onLoad = buildMenu;
		_myXML.load("myMenu.xml");
	}
	function buildMenu()
	{
               trace(_myXML); // returns 'undefined':
	}
}

```

The xml onLoad handler runs but the trace statement returns ‘undefined’.  
The .FLA that uses this class looks like this:

```auto

import Menus.DropSlideMenu;

mytest = new DropSlideMenu();

```

Does anyone understand whats going on? I hope this is just a silly error because of the xmas booze.  
Thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 28, 2003, 10:59am UTC](https://forum.kirupa.com/t/xml-in-actionscript-2-class/38651/2 "2003-12-28T10:59:56Z")

</div>

```auto

function buildMenu(success)
        {
                trace(success); // what does this trace?        
}

```

trace tracing ‘this’ and ‘\_parent’ and a combination of those and work from there.
