HTML format.
Use this for importing from, or exporting to, a TextFlow using the HTML fomat.
The Text Layout Framework HTML supports a subset of the tags and attributes supported by
the TextField class in the flash.text package.
The following table lists the HTML tags and attributes supported for the import
and export process (tags and attributes supported by TextField, but not supported by
the Text Layout Framework are specifically described as not supported):
Tag
Description
Anchor tag
The <a> tag creates a hypertext link and supports the following attributes:
-
target: Specifies the name of the target window where you load the page.
Options include _self, _blank, _parent, and
_top. The _self option specifies the current frame in the current window,
_blank specifies a new window, _parent specifies the parent of the
current frame, and _top specifies the top-level frame in the current window.
-
href: Specifies a URL. The URL can
be either absolute or relative to the location of the SWF file that
is loading the page. An example of an absolute reference to a URL is
http://www.adobe.com; an example of a relative reference is
/index.html. Absolute URLs must be prefixed with
http://; otherwise, Flash treats them as relative URLs.
Note: Unlike the TextField class, ActionScript link events
are not supported. Neither are
a:link, a:hover, and a:active styles.
Bold tag
The <b> tag renders text as bold. A bold typeface must be available for the font used.
Break tag
The <br> tag creates a line break in the text.
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.
-
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. If the specified font is not installed on the local computer system or isn't embedded in the SWF file,
Flash Player selects a substitute font.
-
size: Specifies the size of the font. You can use absolute pixel sizes, such as 16 or 18
or relative point sizes, such as +2 or -4.
-
letterspacing: Specifies the tracking (manual kerning) in pixels to be applied to the right of each character.
-
kerning: Specifies whether kerning is enabled or disabled. A non-zero value enables kerning, while zero disables it.
Image tag
The <img> tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and
movie clips inside text.
The <img> tag supports the following attributes:
-
src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip
symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG, GIF, PNG,
and SWF files) do not show until they are downloaded completely.
-
width: The width of the image, SWF file, or movie clip being inserted, in pixels.
-
height: The height of the image, SWF file, or movie clip being inserted, in pixels.
Note: Unlike the TextField class, the following attributes are not supported:
align, hspace, vspace, id, and checkPolicyFile.
Italic tag
The <i> tag displays the tagged text in italics. An italic typeface must be available
for the font used.
List item tag
Note: Unlike the TextField class, the List item tag is not supported.
Paragraph tag
The <p> tag creates a new paragraph.
The <p> tag supports the following attributes:
-
align: Specifies alignment of text within the paragraph; valid values are left, right, justify, and center.
-
class: Specifies a class name that can be used for styling
Span tag
The <span> tag supports the following attributes:
-
class: Specifies a class name that can be used for styling. While span tags are often used to set a style defined in a style sheet,
TLFTextField instances do not support style sheets. The span tag is available for TLFTextField instances to refer to a class with
style properties.
- You can also put properties directly in the span tag:
<span fontFamily="Arial">Hi there</span>. However, nested span tags are not supported.
Text format tag
The <textformat> tag lets you use a subset of paragraph formatting
properties of the TextFormat class within 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:
-
indent: Specifies the indentation from the left margin to the first character
in the paragraph; corresponds to TextFormat.indent. Both positive and negative
numbers are acceptable.
-
blockindent: Specifies the indentation applied to all lines of the paragraph.
-
leftmargin: Specifies the left margin of the paragraph, in points; corresponds
to TextFormat.leftMargin.
-
rightmargin: Specifies the right margin of the paragraph, in points; corresponds
to TextFormat.rightMargin.
-
leading: Specifies the leading (line height) measured in pixels between a line's ascent and the previous line's descent
-
tabstops: Specifies a comma-separated list of tab stop positions for the paragraph.
Underline tag
The <u> tag underlines the tagged text.
When an unknown tag is imported the textFieldHTMLFormat importer will either set a single FlowElement's typeName property to that tag name
or create a DivElement or a SubParagraphGroupElement with its typeName property set to the tag name.
The textFieldHTMLFormat exporter will export typeName as the XML tag when it is different from the default.