# Menu dropdown woes

**URL:** <https://forum.kirupa.com/t/menu-dropdown-woes/313383>\
**Category:** flash\
**Created:** [August 27, 2010, 5:28pm UTC](https://forum.kirupa.com/t/menu-dropdown-woes/313383 "2010-08-27T17:28:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spmckee](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@spmckee](https://forum.kirupa.com/u/spmckee)\
**Post date:** [August 27, 2010, 5:28pm UTC](https://forum.kirupa.com/t/menu-dropdown-woes/313383/1 "2010-08-27T17:28:17Z")

</div>

I have a drop down menu that I’m having a big issue with. Here’s how it should work:

I have a row of menu buttons. when I click on a button a panel drops down. When I click on the panel the panel stays. When I navigate away from the panel the panel stays. Only when I click off the panel does it disappear but never when I’m on it.

So my approach has been to set a variable whenever I click on a menu to record the current mc. Then, compare that to what’s under the cursor whenever I click.

```auto

//All buttons listener from Array;
for (var k:int=0; k<allArray.length; k++)
{
    main_mc[allArray[k]].addEventListener(MouseEvent.MOUSE_DOWN, nmMouseDown);
}

function nmMouseDown(e:MouseEvent):void
{
    var buttonName:MovieClip = e.currentTarget as MovieClip;
    curMC = buttonName.name;
    main_mc[buttonName.name].gotoAndStop(2);
}

//Stage listener
stage.addEventListener(MouseEvent.MOUSE_DOWN,globalMouseDown);

function globalMouseDown(e:Event):void
{
    if (main_mc[curMC].hitTestPoint(mouseX,mouseY,true))
    {
        //Nothing
    }
    else
    {
        rewindNav();
    }
}

function rewindNav():void
{
    for (var m:int=0; m<allArray.length; m++)
    {
        main_mc[allArray[m]].gotoAndStop(1);
    }
}

```

Any help is greatly appreciated!p

-SP
