Thiago
Thiago

Reputation: 2258

Changing focusrectangle color in flex

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?

Upvotes: 0

Views: 1608

Answers (1)

Wade Mueller
Wade Mueller

Reputation: 6059

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).

Upvotes: 3

Related Questions