I’d like to know a way to measure the real length of a text string in pixels. The problem is that every character has a different width.
The length property informs us of how many characters does the string have…but how do we measure the pixels (x space) in a precise way?
You could also use the [font=courier new]TextField.textWidth[/font] and [font=courier new]TextField.textHeight[/font] properties. These properties will return the actual width/height of the text, unlike the [font=courier new]TextField._width[/font] and [font=courier new]TextField._height[/font] properties that will return the width/height of the text field.