# Senoc's drop-down menu....help

**URL:** <https://forum.kirupa.com/t/senocs-drop-down-menu-help/40355>\
**Category:** flash\
**Created:** [January 17, 2004, 6:13pm UTC](https://forum.kirupa.com/t/senocs-drop-down-menu-help/40355 "2004-01-17T18:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfriction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindfriction/32/172_2.png) [@mindfriction](https://forum.kirupa.com/u/mindfriction)\
**Post date:** [January 17, 2004, 6:13pm UTC](https://forum.kirupa.com/t/senocs-drop-down-menu-help/40355/1 "2004-01-17T18:13:47Z")

</div>

Hi ive followed Senoculars drop-down menu tute  
[http://www.kirupa.com/developer/actionscript/xml\_dropdown\_menu.htm](http://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm)  
, awsome stuff, but it seems the submenu’s dont disappear to well when you roll out. …They only disappear if you click on another menu item or when you click outside the menu.

Anyone got any fixes ?

---

<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:** [July 13, 2004, 6:03am UTC](https://forum.kirupa.com/t/senocs-drop-down-menu-help/40355/2 "2004-07-13T06:03:36Z")

</div>

I’m looking at where mindfriction states that the onRollout code isn’t working due to a typo. This is what I have…

[AS]CreateMainMenu = function(x, y, depth, menu\_xml){  
// generate a menu list  
GenerateMenu(this, “mainmenu\_mc”, x, y, depth, menu\_xml.firstChild);  
// close only submenus if visible durring a mouseup  
// this main menu (mainmenu\_mc) will remain  
mainmenu\_mc.onMouseUp = function(){  
if (mainmenu\_mc.submenu\_mc && !mainmenu\_mc.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)){  
CloseSubmenus();  
}  
};  
};[/AS]  
No typo there like he mentions. But my code only works when i click off the menu, or rollOver another menu item. Any one know why? I’m adding the onRollOut code as well.

[AS]curr\_item.onRollOut = curr\_item.onDragOut = function(){  
// restore color  
var col = new Color(this.background);  
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});  
};[/AS]

(edits)  
Also while I’m asking for a lot might as well ask this. Is there a way to make the menu width dynamic based on the text input? My main links are one word, the sublinks as many as 3 and its just not pretty. I’ll attach my .fla if i can.

Thanks

---

<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:** [July 14, 2004, 2:39am UTC](https://forum.kirupa.com/t/senocs-drop-down-menu-help/40355/3 "2004-07-14T02:39:59Z")

</div>

Hey folks. Got a part of it done. The following AS will expand the textarea and the backround item by 30 pixles without distorting the text. In hindsight it would have taken someone like sen or lostinbeta about 2 seconds to do. I’m just glad I came up with the answer on my own!!

[AS]// movieclip for each menu item  
curr\_item = curr\_menu.attachMovie(“menuitem”,“item”+i+"\_mc", i);  
if (name == “mainmenu\_mc”) {  
curr\_item.\_x = x + i\*(curr\_item.\_width-1);  
curr\_item.\_y = y;  
} else {  
curr\_item.\_x = x;  
curr\_item.background.\_width = curr\_item.\_width + 30  
curr\_item.name.\_width = curr\_item.\_width + 30  
curr\_item.\_y = y + i\*(curr\_item.\_height-1);  
}  
curr\_item.trackAsMenu = true;  
[/AS]

Still have the rollout problem if anyone wants to take a look at that.
