Wednesday 2009/01/21
5:15 PM

Categories: Flash/Actionscript

Flash, CDATA tags and line breaks in htmlText

This is probably obvious to most, but it caused enough of a headache that I’m writing to remind myself down the line: when assigning strings containing <br/> tags remember to set the TextField’s multiline property to true. Otherwise it will happily ignore the HTML line break.


Responses


andy

Wednesday 2009/01/21 6:02 PM

Good to know.


Jesse Gavin

Thursday 2009/07/09 12:04 PM

Also, you are required to set the multiline property to true BEFORE assigning the htmlText property.

This works….

myTextField.multiline = true;
myTextField.htmlText = “Mytest”;

This doesn’t….

myTextField.htmlText = “Mytest”;
myTextField.multiline = true;


ds

Thursday 2009/07/09 12:07 PM

Good point, Jesse. As a rule I tend to set all properties on the text field before assigning to text/htmlText.


Leave a Response