# Complex drop down menu (rollout problem)

**URL:** <https://forum.kirupa.com/t/complex-drop-down-menu-rollout-problem/182276>\
**Category:** flash\
**Created:** [March 16, 2006, 8:21pm UTC](https://forum.kirupa.com/t/complex-drop-down-menu-rollout-problem/182276 "2006-03-16T20:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzus](https://avatars.discourse-cdn.com/v4/letter/g/8edcca/32.png) [@gzus](https://forum.kirupa.com/u/gzus)\
**Post date:** [March 16, 2006, 8:21pm UTC](https://forum.kirupa.com/t/complex-drop-down-menu-rollout-problem/182276/1 "2006-03-16T20:21:38Z")

</div>

Hi there.  
This is my first post.  
I hope someone can help me out with this one.

I can’t figure out how to close this menu when mouse pointer is moved outside the menu.Or is it possible with that kind of solution?

```auto
function openMenu()
{
  if (!menuopen) 
  {
    for (i=0; i<_root.menuArray.length; i++) 
    {
      this._parent.attachMovie("menuitem", "menuitem"+i, i);
      this._parent["menuitem"+i]._x = 190;
      this._parent["menuitem"+i]._y = -35;
      this._parent["menuitem"+i].ydest = -35+(-26*i);
      this._parent["menuitem"+i].itemlabel = _root.menuArray*[0];
      this._parent["menuitem"+i].item = i;

      if (_root.menuArray*[2] == 1)
      {
        this._parent["menuitem"+i].onRollOut = function() 
        {
          this.gotoAndStop("inactive");
        };
        this._parent["menuitem"+i].gotoAndStop("inactive");
      } 
      else 
      {
        this._parent["menuitem"+i].onRollOut = function() 
        {
          this.gotoAndStop("up");
        };
        
        
      }
      this._parent["menuitem"+i].onRollOver = function() 
      {
        this.gotoAndStop("over");
      };
      
      this._parent["menuitem"+i].onPress = function() 
      {
        this.gotoAndStop("down");
        _root.loaditem = this.item;
        _root.loadNext();
        closeMenu (); 
      }
      this._parent["menuitem"+i].transit("_y", this._parent["menuitem"+i].ydest, 15);
    }
    menuopen = true;
    }
  else closeMenu();
}
function closeMenu() 
{
  for (i=0; i<_root.menuArray.length; i++) 
  {
    this._parent["menuitem"+i].removeMovieClip();
    this["menuitem"+i].removeMovieClip();
  }
  menuopen = false;
}
menu_btn.onRollOver = openMenu;

```

---

<div class="post-metadata">

**Author:** ![nele](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@nele](https://forum.kirupa.com/u/nele)\
**Post date:** [March 22, 2006, 11:03pm UTC](https://forum.kirupa.com/t/complex-drop-down-menu-rollout-problem/182276/2 "2006-03-22T23:03:05Z")

</div>

fla is 262KB 🙂

---

<div class="post-metadata">

**Author:** ![gzus](https://avatars.discourse-cdn.com/v4/letter/g/8edcca/32.png) [@gzus](https://forum.kirupa.com/u/gzus)\
**Post date:** [March 23, 2006, 8:18am UTC](https://forum.kirupa.com/t/complex-drop-down-menu-rollout-problem/182276/3 "2006-03-23T08:18:49Z")

</div>

Solved this one already.  
Problaly not the best solution but i’ve just added one big button behind this menu with closeMenu function on RollOver.
