Argument Error... Need some help, please

I’m getting the following output: “ArgumentError: Error #1063: Argument count mismatch on AccordionMenu(). Expected 2, got 0.”

While I’m a noob, I understand what it’s telling me, but can’t figure out for the life of me why it thinks it is getting 0 arguments.

I’m trying to get an accordion menu to load on a mouse click with info loaded from an XML file. The menu I’m using can be found here: http://www.blog.noponies.com/archives/39

It’s a cool menu, but it’s set up with multiple classes. He’s got a custom class for the accordion menu, a custom class for an XML loader, and finally custom class (that he’s using as the document class) to load in the other classes. (He also using TweenLite).

Anyway, I’ve nixed the latter two and am just trying to use the accordion menu as my document class and handle everything else via the ActionScript panel in the timeline. That’s where the code below is in my fla file.

A couple of things, the document that I’m pulling my XML from is called “map.xml.” So “map.XML.button.country.club” is part of the dot-syntax of my XML file.

The original accordion menu was set up to take 3 arguments (a title, an image, and an action). I edited the custom class of the AccordionMenu file to get rid of the action, so it’s just looking for 2 arguments now.

The problem is, it thinks it’s getting 0. There’s a line in the code right below the //comment: “load the menu content…” where I bring in the accordion class, and from what I can figure, I’ve given it two arguments:

  1. “loader.content”
  2. “mapXML.button*.country.club[p].@name

So, any help on why this is giving me the error that it’s not getting 2 arguments?

Thanks in advance and sorry for the length, but, like I say, I’m new to this. So I’m trying to err on the side of clarity.

import flash.events.MouseEvent;

var dynFileName:String
var xmlLoader:URLLoader = new URLLoader();
var mapURL:URLRequest = new URLRequest(“map.xml”);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(mapURL);

//vars for the loop to load the names into the accordion menu
var p:int = 0;
var menuy:int = 0;
var loader:Loader;

var mapXML:XML = new XML();
mapXML.ignoreWhitespace = true

function xmlLoaded(evt:Event):void{
mapXML = XML(xmlLoader.data);//load XML into data
trace(mapXML.button.length());
}

stage.addEventListener(MouseEvent.CLICK, reportClick);

function reportClick(event:MouseEvent):void
{	
	dynFileName = (event.target.name);
	trace("Button Instance Name = " + dynFileName);
	//trace(mapXML.button.@name);
	
	for (var i:Number = 0; i <mapXML.button.length(); i++){
			
		if(dynFileName == mapXML.button*.@name){
			trace(mapXML.button*.country.club.@name);
			trace("Match");
		
		//Building the accordion menu
		
			function loadThumbs():void {
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.INIT, initListener);
			loader.load(new URLRequest(String(mapXML.button*.country.image.text()[p])));

			function initListener(e:Event):void {
			//load the menu content "AccodrionMenu.as" is the document class
			var newMenu:AccordionMenu = new AccordionMenu(loader.content, mapXML.button*.country.club[p].@name);
			addChild(newMenu);
			p++;
			if (p<mapXML.menuitem.length()) {
				loadThumbs();//create loop
			}
		}
	 }
 }
		else{
			trace("No match");
		}
	}
}