Skip to main content
Patel Bharat
Inspiring
October 1, 2010
Question

How to get each line text value from textFlow ?

  • October 1, 2010
  • 1 reply
  • 732 views

Hi,

I want to access each line text value ( same as we can access using 'getLineText( lineNumber )' in text component of  Flex 3 ) ?

Thanks

Bharat Patel

This topic has been closed for replies.

1 reply

Adobe Employee
October 2, 2010

There's no single function for this, but (depending on how the lines were generated) all the information is available. TLF has two basic ways of generating text lines, one using the ContainerController, and one using the TextLineFactory. If you have a standalone TextFlow, it has a IFlowComposer, which has a list of TextFlowLines. Each TextFlowLine has an absoluteStart, which is the text index of the start of the line, and a textLength.

If your TextFlow is part of a TextContainerManager, or if the lines were generated from the TextLineFactory, it gets a little more complex. You can get access to the TextLine using the TextContainerManager's getLineAt function, but the TextLine is by then disconnected from the TextBlock where the Unicode text values are stored. If the TextLines are in order, and start at the start of the flow, you can start at 0 and sum through using the TextLine's rawTextLength property.

Hope this helps,

- robin

Patel Bharat
Inspiring
October 2, 2010

Hi Robin,

Thanks for your time.

I am absolutely agree with your view to get each line text value using the alternative options but I am thinking for single function which will provides the information as we have in earlier version.

Thanks

Bharat Patel