Programmatically resizing Flex Label / Text Component font size, size, weight and color

I can change the label color in Flex Builder, I can even BIND the color for the variable, and it works, but I can not find Color PROPERTY to change or reference it programmatically! What is ActionScript 3.0 code to change the font or color of a piece of text in Flex RIA β€” or cares about what color of your text looks too unusual for an RIA request? I wrote entire applications after a few minutes of β€œlearning” Flex, how did it take me three days, and I still can’t change the color of my dumb label ?!

+4
source share
1 answer

You are confronted with a difference in properties and styles (sometimes called style properties that confuse you). For UIComponent color usually a style.

In mxml, both are initialized as XML attributes; in ActionScript, properties are direct member variables, and styles are considered by the StyleManager .

In short, you set styles by calling UIComponent.setStyle :

 label.setStyle("color", 0xFFFFFF); 
+6
source

All Articles