148 Chapter 8: Working with Text
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”
on page 139.
Anchor tag (<a>)
The
<a> tag creates a hyperlink and supports the following attributes:
• href Specifies the URL of the page to load in the browser. The URL can absolute or relative
to the location of the SWF file that is loading the page.
• target Specifies the name of the target window to load the page into.
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” on page 143.
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:
• color Only hexadecimal color (#FFFFFF) values are supported. For example, the following
HTML code creates red text.
<font color="#FF0000">This is red text</font>
• face Specifies the name of the font to use. You can also specify a list of comma-separated
font names, in which case Flash Player chooses the first available font. If the specified font is
not installed on the playback system, or isn’t embedded in the SWF file, then Flash Player
chooses a substitute font.
Example:
<font face="Times, Times New Roman">This is either Times or Times New
Roman..</font>
For more information on embedding fonts in Flash applications, see TextField.embedFonts
on page 687 and “Setting dynamic and input text options” in Using Flash Help.
• size Specifies the size of the font, in pixels. You can also use relative point sizes (+2 or -4).
<font size="24" color="#0000FF">This is green, 24-point text</font>