Cascading Menu help

Hi. This is from a movie I got over at Flashkit, but these forums are simply more helpful, so here goes. I’m trying to add functions to each ‘submenu’ to load external swfs, but can’t figure it out. What exactly are the instance names of the submenu buttons, so I could just call “submenu1.onRelease = function”…etc? It says to put the button functions in the nc.onRelease function, but I just don’t know what to put.

Here’s the link to the movie file:

http://www.flashkit.com/movies/Interfaces/Menus/Cascadin-scoult01-11370/index.php

And the corresponding AS:

 [LEFT]// Variables -----------------------------------------------------------------------
[LEFT]// Height of Mainmenu items
var homm = 20;
// Height of Submenu items
var hosm = 15;
// mm_array contains the main menu, sm#_array contains the sub menu items for menu #
var mm_array:Array = ["Printed Publications", "Web & Multimedia", "3D", "Exhibitions", "Maps & Plans", "Illustrations"];
var sm1_array:Array = ["Submenu 1", "Submenu 2", "Submenu 3", "Submenu 4"];
var sm2_array:Array = ["Submenu 1"];
var sm3_array:Array = ["Submenu 1", "Submenu 2", "Submenu 3", "Submenu 4", "Submenu 5"];
var sm4_array:Array = ["Submenu 1", "Submenu 2", "Submenu 3", "Submenu 4", "Submenu 5", "Submenu 2", "Submenu 3", "Submenu 4", "Submenu 2", "Submenu 3", "Submenu 4"];
var sm5_array:Array = ["Submenu 1", "Submenu 2", "Submenu 3", "Submenu 4", "Submenu 5"];
var sm6_array:Array = ["Submenu 1", "Submenu 2", "Submenu 3", "Submenu 4", "Submenu 5"];
var submenu_array:Array = [];
// Functions ------------------------------------------------------------------------
_global.$tweenManager.broadcastEvents = true;
// Main menu
function createMainMenu() {
var a = 1;
var total = mm_array.length;
while (a<=total) {
ypos = ((a-1)*homm)+1;
attachMovie("mainnav_mc", "mainnav"+a+"_mc", this.getNextHighestDepth()+100, {_x:0, _y:ypos}); // attach the movieClip
var nc = this["mainnav"+a+"_mc"];
nc.menutext = mm_array[(a-1)]; // set the title text for each button
nc.itemnum = a; // set the menu #
a++;
}
}
function moveMenu(num) {
if ((_root.collapsed == true) || (_root.selectedmenu != num)) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var totalmm = mm_array.length;
var a = 1;
while (a<=totalmm) {
mc = this["mainnav"+a+"_mc"];
if (a>num) {
var ypos = (((a-1)*homm)+1)+totalsm*(hosm+1);
mc.tween("_y", ypos, 0.5, "easeOutCubic"); 
} else {
var ypos = ((a-1)*homm)+1;
if (a == num) {
nypos = ypos;
mc.tween("_y", ypos, 0.5, "easeOutCubic", 0, onEnd(num, nypos));
} else {
mc.tween("_y", ypos, 0.5, "easeOutCubic");
}
}
a++;
}
_root.collapsed = false;
} else {
contractMenu()
_root.collapsed = true;
}
}
function onEnd(num, nypos) {
_root.num = num;
createSubMenu(num, nypos);
}
function contractMenu() {
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
var g = 1;
while (g<=mm_array.length) {
ypos = ((g-1)*homm)+1;
this["mainnav"+g+"_mc"].tween("_y", ypos, 0.5, "easeOutCubic");
g++;
}
}
function createSubMenu(num, nypos) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var ypos = nypos+4;
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
submenu_array = [];
var a = 1;
while (a<=totalsm) {
ypos = ypos+hosm+1;
attachMovie("subnav_mc", "subnav"+a+"_mc", a+30, {_x:0, _y:ypos});
if (num != mm_array.length) {
attachMovie("mask_mc", "mask"+a+"_mc", a+990, {_x:0, _y:0});
mask_mc = this["mask"+a+"_mc"];
mask_mc._alpha = 10;
mask_mc.onEnterFrame = function() {
this._height = _parent.container_mc["mainnav"+mm_array.length+"_mc"]._y;
};
this["subnav"+a+"_mc"].setMask(mask_mc);
}
nc = this["subnav"+a+"_mc"];
nc._alpha = 0;
nc.itemnum = a;
nc.menutext = eval(array)[(a-1)];
nc.alphaTo(100, 2);
trace ("main"+num+"_"+a+"sub.swf");
nc.onRelease = function() {// Function to get submenu actions needs to go here
var my_str:String = new String(this);[/LEFT]
 
[LEFT]//_root.select = my_str.slice(18);
};
submenu_array.push("subnav"+a+"_mc");
a++;
}
}
// Build Menu -----------------------------------------------------------------------
_root.collapsed = true;
createMainMenu();[/LEFT]

[/LEFT]