# Apply code in a Movieclip Container Error

**URL:** <https://forum.kirupa.com/t/apply-code-in-a-movieclip-container-error/328501>\
**Category:** flash\
**Created:** [May 21, 2012, 8:01pm UTC](https://forum.kirupa.com/t/apply-code-in-a-movieclip-container-error/328501 "2012-05-21T20:01:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MFRS](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@MFRS](https://forum.kirupa.com/u/MFRS)\
**Post date:** [May 21, 2012, 8:01pm UTC](https://forum.kirupa.com/t/apply-code-in-a-movieclip-container-error/328501/1 "2012-05-21T20:01:01Z")

</div>

I am trying to turn a MovieClip container into a movieclip that hides the menu, except it just doesn’t work. My code is:

Code for the button changing shape and show in screen

```auto
displayHM(1);

function displayHM (hOs) :void {
    if (hideThatMenu !=null) {
        removeChild(hideThatMenu);
        }
        if (hOs == 1) {
            hideThatMenu = new hidemenu();
        }else if (hOs ==2) {
            hideThatMenu = new showmenu();
        }
        hideThatMenu.x=126,40;
        hideThatMenu.y=59,95;
        addChild(hideThatMenu);
        
}

```

and the code for the actions of the button

```auto
function hidemnu (e:MouseEvent) :void{
    if (hOs ==1) {
    Tweener.addTween(mmu,{alpha:0, time:1});
    Tweener.addTween(botMenu,{alpha:0, time:1});
    //displayHM(2);
    }else if(hOs == 2) {
    Tweener.addTween(mmu,{alpha:1, time:1});
    Tweener.addTween(botMenu,{alpha:1, time:1});
    displayHM(1);
    }
    
}

```

Am i doing something wrong?
