I have an array of buttons on stage and a want when one if them is clicked to chage its tint.
But when another one is clicked then the tint of the previous clicked button goes back to normal state , and eventually new clicked button’s tint change.
I am using this code
var buttonsArray:Array = new Array(ai_btn, b_btn, c_btn);
//Loop through the buttons array
for (var i:uint = 0; i < buttonsArray.length; i++) {
//Add event listeners for the button
buttonsArray*.addEventListener(MouseEvent.CLICK, buttonClicked);
}
function buttonClicked(e:MouseEvent):void {
var button:MovieClip = e.target as MovieClip;
TweenMax.to(buttonsArray, .3, {tint: 0xFF0000});// this doesnt work properly
TweenMax.to(button,1,{tint: 0x108ACB});
trace(e.target.name + " was clicked!");
}
Is that possible to be done with TweenMax?