Displaying HTML text

The flash.text.TextField class has an htmlText property that you can use to identify your text string as one containing HTML tags for formatting the content. As in the following example, you must assign your string value to the htmlText property (not the text property) for Flash Player to render the text as HTML:

var myText:String = "<p>This is <b>some</b> content to <i>render</i> as <u>HTML</u> text.</p>";
myTextBox.htmlText = myText;

Flash Player supports a subset of HTML tags and entities for the htmlText property. The flash.text.TextField.htmlText property description in the ActionScript 3.0 Language and Components Reference provides detailed information about the supported HTML tags and entities.

Once you designate your content using the htmlText property, you can use style sheets or the textformat tag to manage the formatting of your content. For more information, see Formatting text.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000223.html