1 Reply Latest reply on Oct 29, 2009 6:02 PM by Flex harUI

    Problem with TextArea htmlText and the height/num of lines

    Ethryxx

      I am trying to create a TextArea that displays html and auto sizes the height so that there is no scrollbar. I have got this to work with the .text property although when using.htmlText, the values returned are way off. Assuming "field" is the TextArea, I am using the following coding:

       

      var nlines:int = field.mx_internal::getTextField().numLines;

       

      And then to get the height of each line (assuming i is the index of the line):

       

      var lineHeight:int = field.mx_internal::getTextField().getLineMetrics(i).height;

       

      When doing this with .text it works great. When introducing html into the TextArea, my "nlines" value (which is the number of lines in the TextArea) is returning extremely high values. It seems as if numLines is returning the amount of lines that the TextArea would have if it didn't parse the HTML.

       

      What can I do to get the true value of numLines when using htmlText? Thanks