Skip to main content
February 4, 2011
Question

Getting lines from a TextFlow

  • February 4, 2011
  • 1 reply
  • 977 views

Hi,

I need to make a mechanism where I can show line numbers along with the TLF text displayed in my TextArea.

So is there a way to get the number of lines created by the TextFlow, so that we can know the amount of lines created.

Thanks

This topic has been closed for replies.

1 reply

Participant
February 4, 2011

Hi,

You can get the number of lines from the FlowComposer.

For example:

_textFlow.flowComposer.numLines

/Peter

February 4, 2011

Thanks Peter.

I got the number of lines. But on what basis are these lines actually computed.

Are these dependent on the number of lines calculated as per the width of my Text Area or on some other basis ?

Adobe Employee
February 4, 2011

The lines are composed to the width of your TextArea.  Note that if there is overflow TLF will stop composing at the end of the displayed area and numLines may not be accurate.  To force a full compose make this call.

textFlow.flowComposer.composeToPosition();


That forces all the lines to be composed.  Then check numLines.

Hope that helps,

Richard