Appendix C. Supported HTML Tags

Supported HTML Tags

Flash text input fields support a small subset of HTML for formatting. This formatting only works if the Format As HTML box is checked in the Properties panel or if the field's text is assigned to its htmlText property rather than its text property.

TaG

Description

<a>

Anchor tag. Creates a hyperlink. Supports the target attribute, with possible values of _self, which references the current window and has no effect outside of frames-based sites; _blank, which opens the link in a new browser window; _top and _parent, both of which have no effects outside of frames-based sites. Also supports href, a required atttibute to specify the target page for the link. You can specify either a relative path, such as "index.html"; an absolute path, such as "http://www.robhuddleston.com"; or a reference to an ActionScript function, such as "event:someText". When using event, Flash Player dispatches a TextEvent event; in this case, the event's text property would be set to someText. You can create a function to handle the event, just like any other event, and respond accordingly.

 

Bold tag. Renders the enclosed text in a bold typeface. If a bold typeface does not exist for the current font, the tag will have no effect.

<br>

Break tag. Inserts a line break. The field's multiline property must be set to true for this to work.

<font>

Font tag. Formats the enclosed text. Supported attributes include color, which takes a hexadecimal color value in the form #RRGGBB; face, which takes the name of one or more fonts in a comma-separated list to be used to display the text; and size, which can take either absolute pixel sizes such as 12 or 18 or relative sizes such as +1 or −3.

<img>

Image tag. Inserts the specified image into the field. JPG, GIF, PNG, SWF, and MovieClips can be inserted. Text will flow around the inserted image. The field must have its multiline property set to true. You need to specify the path to the image to be inserted via the tag's src property. You can use either a relative or absolute path. If referencing a MovieClip, you need to use its linkage identifier, set through the Properties dialog box in the library. src is the only required attribute. You can optionally include the width and height, each in pixels. You can use align for the horizontal alignment of the image within the field; valid values are left and right — left being the default. The space around the image can be controlled with the hspace and vspace attributes; the default for both is 8 pixels. You can control the embedded image via ActionScript by providing an ID, which then serves as an identifier for the MovieClip that Flash creates to hold the image.

 

Italic tag. Renders the text as italic if an italic typeface exists for the current font.

<li>

List item. Creates an item in a list. Flash Player does not recognize either the <ol> or <ul> tag, so all lists are unordered and bulleted.

<p>

Paragraph tag. Creates a paragraph within the text. The field's multiline property must be set to true. You can optionally include an align attribute to change the text's alignment within the paragraph to left, right, center, or justify or a class attribute to reference a CSS class selector to style the paragraph, as defined by a flash.text.StyleSheet object.

<span>

Span tag. Creates a span within the text, usually to apply a style via the tag's optional class attribute. Note that ID selectors do not work in Flash Player to apply styles.

<textformat>

The text format tag is not technically an HTML tag, but it is supported nonetheless. It supports as optional attributes blockindent, which indents the text from both margins by the specified number of points; indent, which indents the first line of text and accepts both positive and negative values; leading, to set the leading, or space, between lines of text, leftmargin and rightmargin to indent either side by the speficied number of points; and tabstops, with takes an array of non-negative integers. Note that leading is set as a number of pixels between lines and is not measured as baseline-to-baseline as in traditional graphic design applications or even HTML. Therefore, if you are using 12-pixel text and want to add a half line between each line, you should set your leading to 6, not 18.

<u>

Underline tag. Underlines the specified text. Should be used with extreme caution to avoid confusion with hyperlinks.

HTML Entities

Flash Player also supports a set of character entities that enable you to insert characters that would otherwise be illegal:

Entity

Description

&amp;

Ampersand, &

&lt;

Less than, <

&gt;

Greater than, >

&quot;

Double quotes,"

&apos;

Apostrophe or single quote,'

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.62.103