I got a textField (html text) that is very dynamic, and I have to resize the box to fix it and calculate the space occupied. I'm using...
myTextField.height = myTextField.textHeight;
But the result is not very precise, even the Adobe description says that is not. There is a better way to do it? There is some "auto resize" propriety of this class? And for the last: what is the purpose of this "textHeight" if it doesn't provide the real text height?
TextField class has a getLineMetrics() method which returns TextLineMetrics.
There are nice examples on both pages.
You can get the number of text lines in a multiline text field with numLines() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With