Flash Lite 2.x and 3.0 ActionScript Language Reference

condenseWhite (TextField.condenseWhite property)

public condenseWhite : Boolean

A Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in an HTML text field should be removed when the field is rendered in a browser. The default value is false.

If you set this value to true, you must use standard HTML commands such as <BR> and <P> to place line breaks in the text field.

If the text field's .html is false, this property is ignored.

Example

The following example creates two text fields, called first_txt and second_txt. The white space is removed from the second text field. Add the following ActionScript to your FLA or ActionScript file:

var my_str:String = "Hello\tWorld\nHow are you?\t\t\tEnd";

this.createTextField("first_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
first_txt.html = true;
first_txt.multiline = true;
first_txt.wordWrap = true;
first_txt.condenseWhite = false;
first_txt.border = true;
first_txt.htmlText = my_str;

this.createTextField("second_txt", this.getNextHighestDepth(), 180, 10, 160, 120);
second_txt.html = true;
second_txt.multiline = true;
second_txt.wordWrap = true;
second_txt.condenseWhite = true;
second_txt.border = true;
second_txt.htmlText = my_str;

See also

html (TextField.html property)