Skip to main content
Feb 7, 2011 3:39 PM UTC
Question

How to retrieve text from TextLines

hi,

I'd like to compute the text which is displayed by n number of TextLines. I was trying to obtain the text displayed by a single TextLine through

composer.getLineAt(0).getTextLine().textBlock.content.text

but this displays much more than what this TextLine actually draws.

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Feb 7, 2011 4:24 PM UTC

got it

var str:String = "";         var flowComposer:IFlowComposer = textFlow.flowComposer;         var lineLimit:uint = Math.min(n, flowComposer.numLines);         var flowLine:TextFlowLine = flowComposer.getLineAt(lineLimit - 1);         var endIndex:uint = flowLine.absoluteStart + flowLine.textLength;         return textFlow.getText(0, endIndex);

Translate