2 Replies Latest reply on Jun 18, 2009 12:09 PM by SiHoop

    How to measure the width of a text field

    SiHoop Level 1

      I'm trying to break apart a textfield into a series of shorter text fields that will be placed at different locations on the stage. To do this I format text and then measure the length of various segments from the original text field. I use the width of another text field to determine where each line break will come, and here is my problem. I am having difficulty calculating the exact points where the line breaks should be made and how many pixels will be taken up by words that wrap to the next line. I suspect that the problem is due to a border around the original text field-- I know that the border can be turned on/off, but suspect that it accounts for a few pixels on the left and right of the text field. For example, I believe a text string that measures exactly 100 pixels will not fit into a text field of 100 pixels without a line break due to the presence of the boder. It will cause a line break to be implemented. Does anyone know if this is correct, and if it is, how wide if the border on each side of the text field?