Skip to main content
Patel Bharat
Inspiring
Oct 1, 2010 11:49 AM UTC
Question

How to get each line text value from textFlow ?

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

Adobe Employee
Oct 2, 2010 12:44 AM UTC

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

Translate
Patel Bharat
Inspiring
Oct 2, 2010 5:50 AM UTC

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

Translate