
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Using HTML for Input and Output
|
999
For more information on using quotation marks to form strings, see “String Literals”
in Chapter 4.
Unrecognized Tags and Attributes
Like web browsers, Flash ignores tags and attributes it does not recognize. For exam-
ple, if we assign the following value to an HTML text field in Flash:
<P>Please fill in and print this form</P>
<FORM><INPUT TYPE="TEXT"></FORM>
<P>Thank you!</P>
the output will be:
Please fill in and print this form
Thank you!
The
FORM and INPUT elements are not supported by Flash, so both are ignored. Simi-
larly, if we use container elements such as
<TD>, the content is preserved but the
markup is ignored. For example:
myTextField = "<TABLE><TR><TD>table cell text</TD></TR></TABLE>";
outputs the following line without table formatting:
table cell text
However, in Flash 5 and Flash 6, if a tag is not terminated, the entire text that fol-
lows is considered part of the tag and will not display on screen. For example, given
the following assignment:
theField_txt.htmlText = "We all know that 5 < 20. That's obvious.";
Flash displays:
We all know that 5
To include a
< character in an HTML text field, use the entity < as follows:
theField_txt.htmlText = "We all know that 5 < 20. That's obvious.";
Flash displays:
We all know that 5 < 20. That’s obvious. ...