
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
998
|
Appendix E: HTML Support in Text Fields
Entity Support
Flash HTML text fields also support the special character entities listed in Table E-1.
Wherever an entity appears in a text field’s
TextField.htmlText property, Flash dis-
plays the corresponding character on screen. However, other common entities, such
as
©, and numeric entities, such as ™ (trademark symbol), are not sup-
ported. To include characters such as the copyright symbol, the trademark symbol,
or the euro, use Unicode-format text files, a Unicode escape sequence, or the String.
fromCharCode() method (see “Character Encoding” in Chapter 4). The following
example shows how to include a euro symbol in an HTML text field:
this.createTextField("price_txt", 0, 100, 100, 200, 30);
price_txt.html = true;
// The euro is represented by the escape sequence \u20AC
price_txt.htmlText = "<B>FINAL COST:</B> \u20AC 200";
Quoting Attribute Values
Outside of Flash, HTML attribute values can be quoted with single quotes, double
quotes, or no quotes at all. The following tags are all valid in most web browsers:
<P ALIGN=RIGHT>
<P ALIGN='RIGHT'>
<P ALIGN="RIGHT">
But in Flash, unquoted attribute values are not allowed. For example, the syntax
<P ALIGN=RIGHT> is illegal in Flash. However, both single and double quotes can be
used to ...