rollover state to stay in flash
- Started
- Last post
- 6 Responses
- ksv123
I have a button that rolls oevr to another color, how do I get it to stay in the rollover state when we are in that section. Each button in the nav loads a separate swf into the main movie.
Thanks
- acescence0
hide the button and overlay a graphic with the over state, or swap the button with a version that has over state as non-over state. or transform the color with actionscript.
- lvl_130
you just need to create a custom function like for example:
your_btn.onRollOver = function() {
your_MC.colorTo(0xffb1b2, 0.5, "linear");
};
- ifeltdave0
as 2 or 3?
- kult0
Million ways to do this. Easy way:
var selected:MovieClip;
function mouseOver(event:MouseEvent) {
if(selected != event.currentTarget)
//dorollover here
}function mouseClick(event:MouseEvent) {
selected = event.currentTarget;
}
- fyoucher10
or you can use a variable, if you want to track it and use it for other things.
var currentSection:String = "home";
//Add your basic button code, every time you get to a section you set that variable to whatever the section is called, and then just write a condition to check the "currentSection" on rollover, rollout, etc etc
on rollover code example:
if (currentSection == "aboutUs") {
doThisFunction();
} else {
doNothing();
}//Obviously replacing the strings and functions with your own.
- ksv1230
thanks peeps