[ Team LiB ] |
Recipe 8.11 Condensing Whitespace8.11.1 ProblemYou want to condense whitespace in an HTML text field display. 8.11.2 SolutionSet the object's condenseWhite property to true. 8.11.3 DiscussionWhen you use HTML in a text field, the optional condenseWhite setting condenses whitespace, as is done in most HTML browsers. For example, the following text would be rendered in a web browser with only a single space between "hello" and "friend" in spite of the fact that the original source has multiple spaces between the two words: hello friend In ActionScript text fields, however, all of the spaces are displayed unless you set the condenseWhite property to true. myTextField.html = true; myTextField.condenseWhite = true; myTextField.htmlText = "hello friend"; // Displays: "hello friend" The condenseWhite property works only when the html property is true. 8.11.4 See AlsoRecipe 8.10 and the XML.ignoreWhite property |
[ Team LiB ] |