You want to format the text in a text field.
Use HTML tags, pass a TextFormat object to the TextField.setTextFormat() method, or use a
StyleSheet object, and apply it to the text
Although you can set the color of the entire contents of the
text field using the
property, for example, the TextField class doesn’t offer precise
control over character formatting. However, there are several ways in
which you can apply more exacting formatting to text fields:
Use HTML tags to apply formatting. For example, you can
Use a TextFormat object.
Each of the three ways in which you can apply formatting to a text field has its own advantages and disadvantages. Applying HTML formatting is relatively simple, but it is the most difficult to manage of the different techniques. Using a TextFormat object is the more complex than applying formatting via HTML. However, when you want to apply complex formatting, it is a better option than HTML formatting. Using CSS with a StyleSheet object allows the greatest flexibility, and it allows you to load a CSS document, which makes it simple to maintain because you can edit the CSS document without having to re-export the .swf file.
For fast and simple formatting, HTML tags are simplest. For example, the following code displays bolded and underlined text:
field.html = true; field.htmlText = "<b>Bold text</b> <u>Underlined text</u>";
You can use ...