PDA

View Full Version : changing colors of two instances in a single click



fandalis
April 8th, 2009, 07:17 PM
Hi guys,
Can i change the colors of two mc's if i just click one of them? i tried to put the other mc (btn02) inside the function but only btn01 changes color when i click it.

here's the code;



var controlcolor:Color = new Color(btn01);
var controlcolor2:Color = new Color(btn02);


btn01.onPress = function(){
controlcolor.setRGB(0x000000);
btn02.controlcolor2.setRGB(0x000000);
}

Swooter
April 9th, 2009, 11:25 AM
Try:

var controlcolor:Color;
btn01.onRelease = function():Void {
controlcolor = new Color(btn01);
controlcolor.setRGB(0x000000);
controlcolor = new Color(btn02);
controlcolor.setRGB(0x000000);
};