# Problem with menu active/inactivity

**URL:** <https://forum.kirupa.com/t/problem-with-menu-active-inactivity/181923>\
**Category:** Uncategorized\
**Created:** [March 14, 2006, 9:23am UTC](https://forum.kirupa.com/t/problem-with-menu-active-inactivity/181923 "2006-03-14T09:23:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pointer](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@pointer](https://forum.kirupa.com/u/pointer)\
**Post date:** [March 14, 2006, 9:23am UTC](https://forum.kirupa.com/t/problem-with-menu-active-inactivity/181923/1 "2006-03-14T09:23:35Z")

</div>

From inside another function wich is building 2 menu’s from XML.

```auto

mainMenu.id = i;
mainMenu.onPress = mainPressed;

rightMenu.id = i;
rightMenu.onPress = subPressed;

```

BUG:  
The only thing is that somethimes the menu wont have the right id, and is inactive!

How can i check secure if one is active, and if yes, slide the older Out.

```auto

var prevID:Number;
function subPressed() {
    var prevMc:MovieClip = this._parent["rightMenu"+prevID];
    prevMc.enabled = true;
    prevMc._alpha = 50;
//slideOut
    var s:Slide = new Slide(navigation[prevID], 1300);
    s.moveClipTo(200, navigation[prevID]._y, 2);

    this._alpha = 100;
    this.enabled = false;
//slideIn;
    var s:Slide = new Slide(navigation[this.id], 1300);
    s.moveClipTo(5, navigation[this.id]._y, 2);
    prevID = this.id;
}
function mainPressed() {
    var prevMc:MovieClip = this._parent["mainMenu"+prevID];
    prevMc.enabled = true;
    prevMc._alpha = 50;
//slideOut;
    var s:Slide = new Slide(navigation[prevID], 1300);
    s.moveClipTo(200, navigation[prevID]._y, 2);

    this._alpha = 100;
    this.enabled = false;
//slideIn;
    var s:Slide = new Slide(navigation[this.id], 1300);
    s.moveClipTo(5, navigation[this.id]._y, 2);
    prevID = this.id;
}

```

Thnx in advanced
