flashbuttoncs4

Change color of an instance of a button in CS4 Flash


I have 2 instances of a button wich is red and has a white label

I have to edit the buttons so one button is red, and the other is green

I was doing this, but when applied Also the title of label goes green instead of being white...

var btn = new MY_button();
var myColorTransform = new ColorTransform();
myColorTransform.color = 0x179d20;
btn.transform.colorTransform = myColorTransform;

How do i keep the white color of the button label??

I tried, but this not seems to work

btn.background = true; 
    btn.backgroundColor = 0x179d20;

Solution

  • You don't have to use a color transform for this - you can just change the background property.

    var btn = new MY_button();
    btn.background = 0x179d20;