# Button actions affecting separate movieClip

**URL:** <https://forum.kirupa.com/t/button-actions-affecting-separate-movieclip/141376>\
**Category:** Uncategorized\
**Created:** [March 19, 2005, 1:05pm UTC](https://forum.kirupa.com/t/button-actions-affecting-separate-movieclip/141376 "2005-03-19T13:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![graylensman](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@graylensman](https://forum.kirupa.com/u/graylensman)\
**Post date:** [March 19, 2005, 1:05pm UTC](https://forum.kirupa.com/t/button-actions-affecting-separate-movieclip/141376/1 "2005-03-19T13:05:06Z")

</div>

This is what I want to do:

I have myButton (a button), and I have myClip (a movie clip). When you rollover myButton, myClip appears. When you rollout myButton, myClip disappears. When you click on myButton, myClip appears and stays visible on the stage.

My code so far:

\_root.myClip.\_alpha=0;

\_root.myButton.onRollOver = function(){  
\_root.myClip.\_alpha = 100;  
}

\_root.myButton.onRollOut = function(){  
\_root.myClip.\_alpha = 0;  
}

\_root.myButton.onRelease = function(){  
\_root.myClip.\_alpha = 100;  
}

Now, the obvious problem is even though the onRelease handler sets myClip.\_alpha =100, when you move the cursor off the button, the onRollOut handler kicks in and sets myClip.\_alpha = 0.

How can I “freeze” the myClip\_.alpha state on onRelease and override the rollout setting? Would I use an “if/else” statement?

Thanks for help! 🙂
