Applying styles to a TextField object

To apply a style sheet object to a TextField object, you assign the style sheet object to the text field's styleSheet property.

textObj_txt.styleSheet = styles;

NOTE

Do not confuse the TextField.styleSheet property with the TextField.StyleSheet class. The capitalization indicates the difference.

When you assign a style sheet object to a TextField object, the following changes occur to the text field's normal behavior: