views:

171

answers:

2

I want to find a way to get the character index in a Spark based RichEditableText based on mouse x, y position.

The mx.controls.TextArea has a protected getCharIndexAtPoint() method but I can't find an equivalent of this in the Spark RichEditableText which is disappointing.

Any ideas or recommendations?

A: 

I can see why. seems RichEditableText uses FTE, while TextArea uses TextField, so you can just use TextField::getCharIndexAtPoint. you may just as well have no char at a point.

It's a long time since I've had a a look at FTE, but I think TextLine::getAtomIndexAtPoint would be a good start. Also, you should have a look at TLFTextField::getCharIndexAtPoint.

greetz

back2dos

back2dos