Label.html

Availability

Flash Player 6.0.79.

Edition

Flash MX 2004.

Usage

labelInstance.html

Description

Property; a Boolean value that indicates whether the label can be formatted with HTML (true) or not (false). The default value is false. Label components with the html property set to true cannot be formatted with styles.

You cannot use the <font color> HTML tag with the Label component even when Label.html is set to true. For example, in the following example, the text "Hello" displays black, not red as it would if <font color> were supported:

lbl.html = true;
lbl.text = "<font color=\"#FF0000\">Hello</font> World";

In order to retrieve plain text from HTML formatted text, set the HTML property to false and then access the text property. This will remove the HTML formatting, so you may want to copy the label text to an off-screen Label or TextArea component before you retrieve the plain text.

Example

The following example sets the html property to true so the label can be formatted with HTML. The text property is then set to a string that includes HTML formatting, as follows:

labelControl.html = true;
labelControl.text = "The <b>Royal</b> Nonesuch";

The word "Royal" displays in bold.