htmlText and empty lines
today, i was working on a problem that involved TextField, and more specifically, using values from the last line of text. i was trying to get the TextLineMetric of the the last line to do some calculations. this was all fine and dandy until I coupled this new utility with another that modifies the htmlText property of the TextField i was working with. here is what i learned:
changing the value of htmlText on a TextField always creates one extra empty line of text.
i found no indication as to why, and i could see by doing plenty of traces that the htmlText did not indicate to create any new line of text.
so here is the fix:
textField.replaceText(textField.text.length - 1, textField.text.length, "");
apparently that grabs our magic extra line and gets rid of it. great.
i may update this post to include some of the test that i did which proved that changing htmlText always results in this extra line, but another time.
