I have been having some real difficulty with measuring textArea heights. It's something that I have spent a lot of time trying to figure out why, or rather how to accurately get the height of a textfield. I have a complex layout, with many nested canvas and vbox containers, about 10. The problem is that although the height of my components are set to 100%, flex won't enlarge the containers to show all the text in the text box. So, here's what i did... i tapped into the internals and calculated my own measurement, this works, however when the fontSize goes up over 30, this weird amount of padding is added to the top and bottom of the textfield (an unrelated issue I believe)?
Flex sometimes requires a lot of "hacking" by extending and overriding measure, etc. to make my app look exactly like I want. Also, I am hoping that scrollbars in the new version of flex will take any width, I drew programmatic ones but i hate he 20 pixel "fixed" default, they work, but it's sort of kludge to make them draw exactly perfectly. Do you know of any scrollcomponents that work under any width out there for flex? Any suggestions. Here's my function to get the textArea height to be correct for my app. public function get trueTextHeight():uint{ if (!textArea) return 0; var nLines:uint = textArea.mx_internal::getTextField().numLines; var nChars:uint = textArea.length; var metrics:TextLineMetrics = textArea.measureHTMLText(_description); var rowsH:Number = (metrics.height * nLines)+5; this.textArea.mx_internal::getTextField().height = rowsH; //forces textHeight to be 100% this.height = rowsH; return rowsH; } Thanks, patrick