Supported HTML tags

This section lists the built-in HTML tags supported by Flash Player. You can also create new styles and tags using Cascading Style Sheets; see Formatting text with Cascading Style Sheets.

Anchor tag (<a>)

The <a> tag creates a hyperlink and supports the following attributes:

For example, the following HTML snippet creates the link "Go home," which opens www.macromedia.com in a new browser window.

<a href="../home.htm" target="_blank">Go home</a>

You can also define a:link, a:hover, and a:active styles for anchor tags by using style sheets. See Styling built-in HTML tags.

Bold tag (<b>)

The <b> tag renders text as bold. A bold typeface must be available for the font used to display the text.

<b>This is bold text.</b>

Break tag (<br>)

The <br> tag creates a line break in the text field, as shown in this example:

One line of text<br>Another line of text<br>

Font tag (<font>)

The <font> tag specifies a font or list of fonts to display the text.

The font tag supports the following attributes:

Image tag (<img>)

The <img> tag lets you embed external JPEG files, SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. This tag is supported only in dynamic and input text fields that are multiline and wrap their text.

To create a multiline text field with word wrapping, do one of the following:

The <img> tag has one required attribute, src, which specifies the path to a JPEG file, a SWF file, or the linkage identifier of a movie clip symbol. All other attributes are optional.

The <img> tags supports the following attributes:

For more information and examples of using the <img> tag, see Embedding images, SWF files, and movie clips in text fields.

Italic tag (<i>)

The <i> tag displays the tagged text in italics. An italic typeface must be available for the font used.

That is very <i>interesting</i>.

The above code would render as follows:

That is very interesting.

List item tag (<li>)

The <li> tag places a bullet in front of the text that it encloses.

Grocery list:
<li>Apples</li>
<li>Oranges</li>
<li>Lemons</li>

The above code would render as follows:

Grocery list:

Paragraph tag (<p>)

The <p> tag creates a new paragraph. It supports the following attributes:

Span tag (<span>)

The <span> tag is available only for use with CSS text styles. (For more information, see Formatting text with Cascading Style Sheets.) It supports the following attribute:

Text format tag (<textformat>)

The <textformat> tag lets you use a subset of paragraph formatting properties of the TextFormat class within HTML text fields, including line leading, indentation, margins, and tab stops. You can combine <textformat> tags with the built-in HTML tags.

The <textformat> tag has the following attributes:

The following code example uses the tabstops attribute of the <textformat> tag to create a table of data with boldfaced row headers, as shown below:

Name

Age

Department

Tim

32

IMD

Edwin

46

Engineering

To create a formatted table of data using tab stops:

  1. Using the Text tool, create a dynamic text field that's approximately 300 pixels wide and 100 pixels high.
  2. In the Property inspector, enter table_txt in the Instance Name text box, select Multiline from the Line Type menu, and select the Render Text as HTML option.
  3. In the Timeline, select the first frame on Layer 1.
  4. Open the Actions panel (Window > Development Panels > Actions) and enter the following code in the Actions panel:
    var rowHeaders = "<b>Name\t</b><b>Age\t</b><b>Department";
    var row_1 = "Tim\t31\tIMD";
    var row_2 = "Edwin\t42\tQA";
    table_txt.htmlText = "<textformat tabstops='[100, 200]'>";
    table_txt.htmlText += rowHeaders;
    table_txt.htmlText += row_1;
    table_txt.htmlText += row_2 ;
    table_txt.htmlText += "</textformat>";
    

    Note the use of the tab character escape sequence (\t) to add tabs between each "column" in the table.

  5. Select Control > Test Movie to test the movie.

Underline tag (<u>)

The <u> tag underlines the tagged text.

This text is <u>underlined</u>.

The above code would render as follows:

This text is underlined.