E.2 Entity Support

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Appendix E.  HTML Support in Text Fields

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 displays the corresponding character on screen. However, other common entities, such as ©, and numeric entities, such as ™ (trademark symbol), are not supported. 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 Section 4.5.1). 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";

Table E-1. Supported entities

Entity

Character Represented

&lt;

<

&gt;

>

&amp;

&

&quot;

"

&apos;

'

&nbsp;

nonbreaking space



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net