How to find text width of a TextField in Action Script Flash Professional cs6

note : In action script 2 getTextExtent() method gives width, height, ascent, descent, textFieldHeight, and textFieldWidth of text in the TextField, but in action script 3 to get above things use one of the below methods.

It is very easy to find out width, height, ascent, descent, textFieldHeight, and textFieldWidth of text in the TextField. There are two methods are there

1. Finding width and height of text in the TextField using textWidth and textHeight property of the TextField.

2. Finding width and height of text in the TextField using getLineMetrics() method of the TextField with help of TextLineMetrics class.

Here is the example code above two methods.

 Output:

how to find width and height of text in the textField in action script 3 flash professional

Second Method :

 Output :

how to find width,height, ascent and descent of text in the textField using getLineMetrics in action script 3 flash

Posted by:

muni

Leave A Comment

Your email address will not be published. Required fields are marked (required):

Related articles

Back to Top