Getting Dynamic Text Line Count

[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]Does anyone know a quick, efficient way of doing this?[/FONT][/COLOR][COLOR=black][FONT=Arial][/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]I did come across a thread on actionscript.org that gave a brief explanation on how to do it, but it was for older versions of flash, and the code seemed waaay to complex for something so simple. I’d like to think such a common, useful method would have been extended into the flash components in newer versions of flash.[/FONT][/COLOR][COLOR=black][FONT=Arial][/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]I’m somewhat new to actionscript, but I’ve worked extensively in other languages, and generally, when I wanted to count the occurrences of a specific character, I just used the universal split function/method to split the string into an array and then I just retrieved the size of the array. Never tried it with line breaks though… and if this method could seemingly be possible what is the char code for a line break in Actionscript?[/FONT][/COLOR][COLOR=black][FONT=Arial][/FONT][/COLOR]

Why do you want to know?
I ask because the result you require may be easier using a different method.

[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]I retrieve text from an external dynamic XML file and insert them into dynamic text fields. The text fields are captions for pictures, and sit just above their respective pictures. [/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]Because the text can be of varying length, it can take up multiple lines, which obviously disrupts the vertical alignment over the picture. [/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]I’d like to be able to determine how many lines the text field has, so I can make the appropriate alignment adjustments dynamically.[/FONT][/COLOR]
[COLOR=black][FONT=Arial] [/FONT][/COLOR]
[COLOR=black][FONT=Arial]Something like this seems pretty straightforward and it would be bizarre if actionscript didn’t include native methods or functions for something like this.[/FONT][/COLOR]
[COLOR=black][FONT=Arial][/FONT][/COLOR]
[COLOR=black][FONT=Arial]Thanks for your help![/FONT][/COLOR]

As different letters take up varied horizontal spaces you may find it easier to use linkage and attachmovie. You can test the height of each movieclip after they have been loaded with content.

eg:
next clips _y = (last clips _height + last clips _y)

Should I go into more detail? or are you with me

:be: