0 Replies Latest reply on Jun 7, 2010 11:48 AM by adamgeework

    Trying to obtain the width or height of a piece of text, but how do I calculate spaces?

    adamgeework Level 1

      for example I have a linkbutton txtIt


      var metrics1:TextLineMetrics = measureText(txtIt.label); trace(metrics1.width);


      I use the width and the textbox width to calculate the amount of lines in a textbox. With numLines I can calculate where to place the next item on the y axis.


      However if a piece of text grabbed from the database has spaces it throws the calculations off.

      Ideally i would want a way to have the user format text in an input field, upload it to the database, and retain the formatting when retrieving the text back into flex.

      Any tips?