hi guys,
this is the issue:
i have a series of button that open a drag box with textfield and a close button in it. The drag box has to have the same colour of the button. So here it goes:
[COLOR=DimGray]// array of buttons[/COLOR]
var quadratini:Array = [muh,miao];
[COLOR=DimGray]// array of colours[/COLOR]
var colori_qua:Array = [0x000033,0xCC0000];
var boxneutro:box = new box();
var ics:chiudi = new chiudi();
var box_text:TextField = new TextField();
boxneutro.addChild(ics);
boxneutro.addChild(box_text);
[COLOR=DimGray]// for loop through the bottons[/COLOR]
for (var k:int = 0; k <quadratini.length; k++) {
quadratini[k].addEventListener (MouseEvent.CLICK, app);
}
function app (event:MouseEvent):void {
[COLOR=DimGray]// array of buttons is associated to the array of colours[/COLOR]
quadratini.index == colori_qua.index;
for (var k:int = 0; k <colori_qua.length; k++)
{
if (event.target == quadratini[k]) {
var cambia:ColorTransform=boxneutro.transform.colorTransform;
[COLOR=DimGray]// the box takes the colour of the botton clicked[/COLOR]
cambia.color=colori_qua[k];
boxneutro.transform.colorTransform=cambia;
}
}
the problem is that also the box’s children inherit the same colour and so they become invisible.
How’s possible to avoid that? :-/