Situation: I’ve got 3 buttons on the left side of my flash movie that each fade in their corresponding content on the right. The buttons currently have a visual “glow” that fades in and out as you mouseover them. BUT, I want the glow to stay if you click on the button.
**Problem:** I tried setting _global.clicked3 to 1 on release, and then (by design) the glow should not fade out. The on rollOut should check to see if _global.clicked3 = 0, and if it does, fadeOut, if it does not, do nothing.
Then of course each time you click a button it fades out the “glow” on the other two buttons, and sets their global variables to “0”.
As soon as I put the IF statement in the on rollOut, the "glow" won't fade out anymore on rollOut.
Maybe there is another way to do this? 1) Keeping my nice fading glow effect, 2) having it stay when you click a button, and 3) have it fade the other 2 buttons out.
on (release, releaseOutside) {
_root.content.fadeOut(_root.content.button1.button_fade);
_root.content.fadeOut(_root.content.button2.button_fade);
_root.content.fadeOut(_root.content.content_group1);
_root.content.fadeOut(_root.content.content_group2);
_root.content.fadeIn(_root.content.content_group3);
_global.clicked1 = 0;
_global.clicked2 = 0;
_global.clicked3 = 1;
}
on (rollOver) {
_root.content.fadeIn(_root.content.button3.button_fade);
}
on (rollOut) {
if (_global.clicked3 = 0) {
_root.content.fadeOut(_root.content.button3.button_fade);
}
}
Note: I don’t know why those spaces (at end of lines) are showing up here on kirupa, it looks fine when I am in edit mode.
My source is too big to upload, so I put it on my web server. Here are the URLs to view the movie, and to get the source:
[http://www.kylehaskins.com/files/flash1/index.html](http://www.kylehaskins.com/files/flash1/index.html)
[http://www.kylehaskins.com/files/flash1/home.fla](http://www.kylehaskins.com/files/flash1/home.fla)
In the flash movie the buttons live here:
content (movieclip) > buttons (layer) > frame 57
button1_mc, button2_mc, and button3_mc each contain the buttons with actionscript.
Note: I’ve got an “if (_global.clicked3 = 0)” on the 3rd button, but a “==” on the other two, so in 1 & 2 you can see them fading in and out. But #3 won’t work.