# XML in ActionScript 2 class

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