# This should be easy, but im cant think

**URL:** <https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596>\
**Category:** Uncategorized\
**Created:** [March 28, 2006, 5:37pm UTC](https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596 "2006-03-28T17:37:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkeren](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@bkeren](https://forum.kirupa.com/u/bkeren)\
**Post date:** [March 28, 2006, 5:37pm UTC](https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596/1 "2006-03-28T17:37:59Z")

</div>

I have a button that reveals a movie clip (menu) how can i make it that on the first click it moves the the fade in of my menu, and then the second click to the fade out  
ive tried onRelease, and all, maybe my if statement isnt right?  
thanks for your time

---

<div class="post-metadata">

**Author:** ![Bokke](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bokke](https://forum.kirupa.com/u/Bokke)\
**Post date:** [March 28, 2006, 5:59pm UTC](https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596/2 "2006-03-28T17:59:02Z")

</div>

You should workt with a variable, lets call it **menuActive**.  
When we first come in the movie **menuActive** will be false.  
Then when we click the button, **menuActive** it will be set to true.  
Finally some code within the button will check if the menu is active or not.

On your first keyframe:

```auto
menuActive = false;

```

Attached to your button:

```auto
on(release){
   if(_root.menuActive){
      menuMc.gotoAndPlay("fadeOut");
      _root.menuActive = false;
   }
   else{
      menuMc.gotoAndPlay("fadeIn");
      _root.menuActive = true;
   }
}

```

:mu:

---

<div class="post-metadata">

**Author:** ![bkeren](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@bkeren](https://forum.kirupa.com/u/bkeren)\
**Post date:** [March 28, 2006, 6:24pm UTC](https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596/3 "2006-03-28T18:24:51Z")

</div>

thank you, but my button is not a button its a movie clip…im sorry for the misdirection…any ideas

---

<div class="post-metadata">

**Author:** ![Bokke](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bokke](https://forum.kirupa.com/u/Bokke)\
**Post date:** [March 28, 2006, 7:15pm UTC](https://forum.kirupa.com/t/this-should-be-easy-but-im-cant-think/183596/4 "2006-03-28T19:15:52Z")

</div>

well, it should also work for a mc.

But if ur mc is the one that holds the menu, it would be something like:

```auto
on(release){
       if(_root.menuActive){
             this.gotoAndPlay("fadeOut");
      _root.menuActive = false;
       }
       else{
             this.gotoAndPlay("fadeIn");
             _root.menuActive = true;
       }
}

```
