I searched this topic many times, but it seems like I'm either outdated or just not working.
With TextFields in the past, you could set the TextField to a specific width, set wordWrap to true, and you will get a text field that changed the height to match the text you added.
Now I am trying to do this using Spark TextArea or RichText.
I tried this HeightInLines = NAN, but it seems deprecated.
I also tried this procedure:
var totalHeight:uint = 10; this.validateNow(); var noOfLines:int = this.mx_internal::getTextField().numLines; for (var i:int = 0; i < noOfLines; i++) { var textLineHeight:int = this.mx_internal::getTextField().getLineMetrics(i).height; totalHeight += textLineHeight; } this.height = totalHeight;
But mx_internal is not in Spark components.
I am trying to do this with AS3 and not with MXML. If anyone has suggestions or links that can help me figure this out with AS3, I would really appreciate it.
Lee loftiss
source share