views:

69

answers:

1

Hi there,

I have a flex app, in which I need to change the color of the focus rectangle of a textinput if the input is empty. This used to work when I was writing inside a mx:script tag, but now I'm writing a new component (an AS3 class that inherits from VBox) myself. And now it isn't working anymore. I used to run the following statement to change color:

txtName.setStyle("themeColor", "#ff0000");
txtName.focusManager.getFocus().drawFocus(true); 

Is it something related to the mxml? How can I fix that?

+1  A: 

Which SDK version are you using? My guess is that you are using 4.x since this is no longer working for you. In versions prior to 4.0, the focus color was derived from the "themeColor". Not so in 4.0+, which now uses "focusColor" for the focus color (naturally).

Wade Mueller