# Horizontal expanding menu, code mod/cleanup help needed

**URL:** https://forum.kirupa.com/t/horizontal-expanding-menu-code-mod-cleanup-help-needed/161014
**Category:** flash
**Created:** [August 31, 2005, 12:03pm UTC](https://forum.kirupa.com/t/horizontal-expanding-menu-code-mod-cleanup-help-needed/161014 "2005-08-31T12:03:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Lesley](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lesley/32/369_2.png) [@Lesley](https://forum.kirupa.com/u/Lesley)
#### Post date: [August 31, 2005, 12:03pm UTC](https://forum.kirupa.com/t/horizontal-expanding-menu-code-mod-cleanup-help-needed/161014/1 "2005-08-31T12:03:12Z")

</div>

Hi There,

My actionscript knowledge is expanding by all the great tutorials here at kirupa and a lot of trial and error. I wanted to make a menu slide out horizontally and add another submenu on the click.

My movie consists of a few mainmenu buttons and some movieclips(per submenu).  
clicking portfolio will expand the first submenu, clicking a button in the submenu will expand the second submenu.

With my limited actionscript knowlegde I got it to work from scratch. but it does still have a few problems.

1. clicking “portfolio” and then “print”, will expand and collapse the submenu of “print”. but when i roll-off the printbutton (without rolling over any other buttons) and then rollover the printbutton de click doesnt expand the submenu of “print”.

2 when having “portfolio”, “print” and its submenu open. When you rollover “profile” I want to have both levels collapsing, but i can’t get it to work properly.

1. I cant get the swapDepth() to work properly so I had to hardcode a depth of -16368.

2. I guess my code will look pretty amateur, so if someone can help cleanup the code, that would be great!

I hope i explained myself good enough. I’ll attach the movie so you guys can look (and shoot 😉 ) at my code. Any help, suggestions etc. are more than welcome. I’ve been staring myself blind on this, and still haven’t got is to work ☹

Thank you!
