Skip to main content
Participant
March 25, 2010
Question

getCharIndexAtPoint() equivalent in Spark RichEditableText

  • March 25, 2010
  • 1 reply
  • 721 views

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?

This topic has been closed for replies.

1 reply

Adobe Employee
March 26, 2010

There is a tlf_internal function you can use to do this. If you can get the textFlow (I think this is the RichEditableText.content), you can call:

import flashx.textLayout.edit.SelectionManager;

import flashx.textLayout.tlf_internal;

use namespace tlf_internal;

SelectionManager.computeSelectionIndex(textFlow:TextFlow, target:Object, currentTarget:Object, localX:Number,localY:Number)

- robin

Participant
May 3, 2011

Robin thank you very much. I was searching whole day to find solution.