Well I can’t upload the fla because it’s too big, but here are the changes I made to the code… I added the AttachMenus function to handle callbacks from the timer.
// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
// as well as any of the submenus
GenerateMenu = function(container, name, x, y, depth, node_xml) {
// variable declarations
var curr_menu = container.createEmptyMovieClip(name, depth);
// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
attachQ = new Array();
for (var i=0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
var mc = “menuitem”;
if (node_xml.childNodes*.nodeName != “menu”){
mc = “menuitem1”;
}
attachQ.push({idx: i, mcname: mc, node: node_xml.childNodes*, x: x, y: y});
}
delay = setInterval(AttachMenus, 1000, curr_menu);
}
AttachMenus = function(curr_menu)
{
var curr_node;
var curr_item;
if (attachQ.length == 0)
{
clearInterval(delay);
return;
}
var info = attachQ.shift();
curr_item = curr_menu.attachMovie(info.mcname,“item”+info.idx+"_mc", info.idx);
curr_item._x = info.x;
curr_item._y = info.y + info.idx*curr_item._height;
curr_item.background._alpha = 0;
tTasks._alpha = 40;
tRoles._alpha = 40;
// item properties assigned from XML
curr_node = info.node;
curr_item.action = curr_node.attributes.url;
curr_item.roles = curr_node.attributes.roles;
curr_item.tasks = curr_node.attributes.tasks;
curr_item.name.text = curr_node.attributes.title;
// item submenu behavior for rollover event
if (curr_node.nodeName == “menu”){
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver = function(){
tweenMenu(slider._y,this._y);
GenerateMenu(curr_menu, “submenu_mc”, 315, 60, 1000, this.node_xml);
};
}else{ // nodeName == “item”
// close existing submenu
curr_item.onRollOver = curr_item.onDragOver = function(){
tasks.text = this.tasks
roles.text = this.roles
curr_menu.submenu_mc.removeMovieClip();
// show a hover color and show titles at full colour
var menuTween:Tween = new Tween(this.background, “_alpha”, Strong.easeOut, 0, 30, .5, true);
var menuTween:Tween = new Tween(_root.tTasks, “_alpha”, Strong.easeOut, 40, 100, .5, true);
var menuTween:Tween = new Tween(_root.tRoles, “_alpha”, Strong.easeOut, 40, 100, .5, true);
};
curr_item.onRollOut = curr_item.onDragOut = function(){
tasks.text = “”;
roles.text = “”;
// restore color
var menuTween:Tween = new Tween(this.background, “_alpha”, Strong.easeOut, 30, 0, .9, true);
var menuTween:Tween = new Tween(_root.tTasks, “_alpha”, Strong.easeOut, 100, 40, .5, true);
var menuTween:Tween = new Tween(_root.tRoles, “_alpha”, Strong.easeOut, 100, 40, .5, true);
};
// any item, menu opening or not can have actions
curr_item.onRelease = function(){
getURL(this.action);
};
}
};