# Lines in a textfield

**URL:** <https://forum.kirupa.com/t/lines-in-a-textfield/59954>\
**Category:** flash\
**Created:** [August 5, 2004, 3:36am UTC](https://forum.kirupa.com/t/lines-in-a-textfield/59954 "2004-08-05T03:36:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mister\_B](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Mister\_B](https://forum.kirupa.com/u/Mister_B)\
**Post date:** [August 5, 2004, 3:36am UTC](https://forum.kirupa.com/t/lines-in-a-textfield/59954/1 "2004-08-05T03:36:16Z")

</div>

How can I get a variable containing the number of lines in a textfield?

It seems simple but I can’t figure it out.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 6, 2004, 9:16am UTC](https://forum.kirupa.com/t/lines-in-a-textfield/59954/2 "2004-08-06T09:16:17Z")

</div>

You may have to do some simple division after finding out how much space one line takes up. You can get the height of a mulitline text field using Actionscript. You could probably even get the height of one line using AS and then use the result to divide the total height of your target field. The result would be apporximate, but after rounding, would accurately respresent the number of lines.

C
