Skip to main content
Known Participant
Aug 19, 2009 9:30 AM UTC
Question

Getting line index at a certain point

Hi,

I'm trying to get access to a line index in a paragraph at a certain point, for example mouse position. However, I only seem to be able to find methods to fetch line index at a text character position...

Also, I'm struggling to be able to hold of the text (the actual characters!) on a line!

Any ideas?

-Timo

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

1 reply

Inspiring
Aug 21, 2009 11:27 PM UTC

See this earlier post: http://forums.adobe.com/thread/461475 for mapping mouse locations to positions.

The text of a particular TextFlowLine can be found something like this:

var para:ParagraphElement = textFlowLine.paragrah;

var paraRelativeStart:int = textFlowLine.absoluteStart - para.absoluteStart;

var paraText:String = para.getText().substr(paraRelativeStart,textFlowLine.textLength);

Hope that helps,

RIchard

Translate