Using ActionScript 3.0 Components |
|
|
|
| Customizing the UI Components > Customizing the TileList > Using styles with the TileList | |||
The TileList's styles specify values for its skins, padding, and text formatting when the component is drawn. The texFormat and disabledTextFormat styles govern the style of the text that displays in the component. For more information about the skin styles, see Using skins with the TileList.
The following example calls the setRendererStyle() method using the textFormat style to set the font, size, color, and text attributes of the labels that display in a TileList instance. The same process applies also to setting the disabledTextFormat style that is applied when the enabled property is set to false.
To set the textFormat style for a TileList instance:myTl.setSize(100, 100);myTl.addItem({label:"#1"});myTl.addItem({label:"#2"});myTl.addItem({label:"#3"});myTl.addItem({label:"#4"});var tf:TextFormat = new TextFormat();tf.font = "Arial";tf.color = 0x00FF00;tf.size = 16;tf.italic = true;tf.bold = true;tf.underline = true;tf.align = "center";myTl.setRendererStyle("textFormat", tf);
|
|
|
|