by Adobe

Adobe logo


25 July 2011

Cascading style sheets (CSS) and HTML-formatted text can be used to format Classic text fields. For example, you can create a text string formatted with HTML tags (<body>, <p>, <div>, <span>, <a>, etc.) and then assign styles to each of the HTML tags in use. The result is a fully styled Flash text field where you can adjust the text formatting from an external CSS file.

This sample demonstrates how to use an external CSS file to format HTML text applied to a Classic text field. Look at helloworld.css as well as the ActionScript code to see how everything fits together.

Tip: Be sure to embed all the fonts defined in your style sheet so that you can see the formatting work as expected. For example, if you'd like to be able to use any combination of Arial regular, bold, and italic, you need to embed Arial regular, Arial bold, Arial italic, and Arial bold italic in the FLA file.