# Actionscript Master - Help My Dynamic Menu in MX

**URL:** <https://forum.kirupa.com/t/actionscript-master-help-my-dynamic-menu-in-mx/950>\
**Category:** flash\
**Created:** [August 3, 2002, 11:56pm UTC](https://forum.kirupa.com/t/actionscript-master-help-my-dynamic-menu-in-mx/950 "2002-08-03T23:56:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moeffee](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@Moeffee](https://forum.kirupa.com/u/Moeffee)\
**Post date:** [August 3, 2002, 11:56pm UTC](https://forum.kirupa.com/t/actionscript-master-help-my-dynamic-menu-in-mx/950/1 "2002-08-03T23:56:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2002, 3:20am UTC](https://forum.kirupa.com/t/actionscript-master-help-my-dynamic-menu-in-mx/950/2 "2002-08-04T03:20:44Z")

</div>

you forgot your fla, dude. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 2:35pm UTC](https://forum.kirupa.com/t/actionscript-master-help-my-dynamic-menu-in-mx/950/3 "2002-08-09T14:35:39Z")

</div>

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.
