I have a whole bunch of buttons that all need to have both a mouse over effect as well as a toggle effect (on click) which changes the hue. I have made the functions for each hue change and that parts works quite well. Sadly I cant figure out how to get my toggle function to work how it is supposed to.
Below is my code for the toggle button. It works fine, except that my variable is global instead of specific for the instance. Therefor it only works if I have just one button. How can I change it to use a variable that is for the one button in focus?
Thanks in advance!
var primary = false;
function clickOn(e:MouseEvent):void{
if (primary == false) {
greenHue(e.target);
primary = true;
} else {
noHue(e.target);
primary = false;
}
}