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!