for (var i=0; i<4;>
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i);
curr_item._x = x;
curr_item._y = y + i*curr_item._height;
curr_item.trackAsMenu = true;
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
curr_item.onRollOut = curr_item.onDragOut = function(){
var col = new Color(this.background);
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
};
curr_item.onRelease = function(){
Actions[this.action](this.variables);
CloseSubmenus();
};
}
};
Createmainmenu = function(x, y, depth, menu_xml){
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild);
mainmenu_mc.onMouseUp = function(){
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseSubmenus();
}
};
};
CloseSubmenus = function(){
mainmenu_mc.submenu_mc.removeMovieClip();
};
Actions = Object();
Actions.gotoURL = function(urlVar){
getURL(urlVar, "_self");
};
Actions.newMenu = function(menuxml){
myXMLfile_xml.load(menuxml);
};
myXMLfile_xml = new XML();
myXMLfile_xml.ignoreWhite = true;
myXMLfile_xml.onLoad = function(ok){
if (ok){
Createmainmenu(10, 10, 0, this);
trace( "message area");
}else{
trace("error: XML not successfully loaded");
}
};
myXMLfile_xml.load("myXMLfile.xml");