Skip to main content
Known Participant
August 19, 2009
Question

Getting line index at a certain point

  • August 19, 2009
  • 1 reply
  • 761 views

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 has been closed for replies.

1 reply

Adobe Employee
August 21, 2009

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