PDA

View Full Version : [MX] setRGB inside btn



Felipe Bastos
September 13th, 2003, 08:13 PM
hey everyone!
Is it possible to use setRGB inside a btn?
I have a buttom that has a textfield and a background.
I want to change only the color of the textfield!

here is the code i`m using:


function AbtnPress() {
for (var i=1; i<8; i++) {
var btn = _root.A["btnA0"+i];
if (btn == this) {
var visitedcolor = new Color(this);
visitedcolor.setRGB(0xFFFFFF);
}
}
}
for (var i=1; i<8; i++) {
_root.A["btnA0"+i].onPress = AbtnPress;
}


thanks

grandsp5
September 13th, 2003, 10:08 PM
textField.backgroundColor = 0xFFFFFF;

senocular
September 13th, 2003, 10:19 PM
instances in buttons lose their instance names as buttons technically arent referencable scopes - or at least not handled as such.

see http://www.kirupaforum.com/forums/showthread.php?s=&threadid=19984

Felipe Bastos
September 14th, 2003, 12:41 PM
Sorry! I need to change the color of the name and not the bg of the texfiled!

Thanks
:)