EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 439

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Using HTML-formatted text 439
Font tag
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:
myText_txt.htmlText = "<font color='#FF0000'>This is red text</font>";
face Specifies the name of the font to use. As shown in the following example, you can
specify a list of comma-delimited font names, in which case Flash Player selects the first
available font:
myText_txt.htmlText = "<font face='Times, Times New Roman'>Displays as
either Times or Times New Roman...</font>";
If the specified font is not installed on the users computer system or isnt embedded in the
SWF file, Flash Player selects a substitute font.
For more information on embedding fonts in Flash applications, see embedFonts
(TextField.embedFonts property) in the ActionScript 2.0 Language Reference and
“Setting dynamic and input text options” in Using Flash.
size Specifies the size of the font, in pixels, as shown in the following example:
myText_txt.htmlText = "<font size='24' color='#0000FF'>This is blue, 24-
point text</font>";
You can also use relative point sizes instead of a pixel size, such as +2 or -4.
Image tag
The <img> tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and movie
clips inside text fields and TextArea component instances. Text automatically flows around
images you embed in text fields or components. To use this tag, you must set your dynamic or
input text field to be multiline and to wrap text.
To create a multiline text field with word wrapping, do one of the following:
In the Flash authoring environment, select a text field on the Stage and then, in the
Property inspector, select Multiline from the Text Type menu.
For a text field created at runtime with createTextField (MovieClip.createTextField
method), set the new text field instances multiline (TextField.multiline property)
and multiline (TextField.multiline property) properties to
true.
The
<img> tag has one required attribute, src, which specifies the path to an image file, a
SWF file, or the linkage identifier of a movie clip symbol in the library. All other attributes
are optional.

Table of Contents

Related product manuals