Actionscript Master - Help My Dynamic Menu in MX

I have a nice looking dynamic menu but only one menu with submenus. Will someone with better Actionscript knowledge than me help out to create menus and submenus below?

I am attaching the exported .as file.

you forgot your fla, dude. :slight_smile:

Woops. OK – I’ve been gone on vacation. But I’m back now and adding the Actionscript here. Anyway, I only have 5 fingers so maybe Montoya will help.

Frame 1:
menu = new Array();
menu[0] = “Submenu”;
menu[1] = “Submenu”;
menu[2] = “Submenu”;
menu[3] = “Submenu”;
menu[4] = “Submenu”;
menu[5] = “Submenu”;
mtext = menu[3];
// movie clip to hold the menu
this.createEmptyMovieClip(“menuClip”, 1);
menuClip._visible = false;
cDepth = 0;
// instance of mpiece
menuClip.attachMovie(“mpiece”, “top”, ++cDepth);
menuClip.top.useHandCursor = false;
menuClip.top.onPress = function () {
menuClip.startDrag();
}
menuClip.top.onRelease = function () {
menuClip.stopDrag();
}
menuClip.top.onReleaseOutside = function () {
menuClip.stopDrag();
}
menuClip.top.mtext = “Main Menu”;
//set the background color and text color of the text field
menuClip.top.t.backgroundColor = 0x666666;
menuClip.top.t.textColor = 0x000000;
for (var i=0; i<menu.length; i++) {
menuClip.attachMovie(“mpiece”, “item”+i, ++cDepth);
menuClip[“item”+i].mtext = menu*;
menuClip[“item”+i]._y = menuClip.top._height + menuClip[“item”+i]._height*i;
menuClip[“item”+i].useHandCursor = false;
menuClip[“item”+i].onRollOver = function () {
this.t.backgroundColor = 0xCCCCCC;
this.t.textColor = 0x000000;
}
menuClip[“item”+i].onRollOut = function () {
this.t.backgroundColor = 0xFFFFFF;
this.t.textColor = 0x000000;
}
}
menuClip.attachMovie(“minmax”, “minmax”, ++cDepth);
menuClip.minmax.useHandCursor = false;
menuClip.minmax._y = 2;
menuClip.minmax._x = menuClip.top._width - menuClip.minmax._width;
menuClip.minmax.maximized = true;
menuClip.minmax.onPress = function () {
if (this.maximized) {
this.maximized = false;
this.gotoAndStop(“max”);
for (var i=0; i<menu.length; i++) {
menuClip[“item”+i]._visible = false;
}
} else {
this.maximized = true;
this.gotoAndStop(“min”);
for (var i=0; i<menu.length; i++) {
menuClip[“item”+i]._visible = true;
}
}
}

Frame 12:
menuClip._visible = true;
stop();
Frame Label “home”

Frame 13:
Frame Label “blank”

In the library I have a dynamic single line text box labeled “t” with a var name “mtext” and I have a minMax movie clip with the two graphics and frame labels “min” on Frame 1 “max” on Frame 2 and stops on each.