0
votes

I want to get the the boundaries of a character in a textfield relative to the stage.

The problem is that getCharBoundaries seems to return the coordinates not relative to the TextFields origin, but relative to the text origin (which may be somewhere outside of the textfield if the textfield is scrolling).

I don't know how to get the actual origin of the text (even if it's not visible within the textfield due to scrolling) so that I can calculate the actual stage coordinates of the character.

Anyone knows how to do this?

//edit: the text in my textfield is formated, so lines don't have equal hight

1

1 Answers

0
votes
myTextField.localToGlobal(new Point());

Then just add your character's coordinates (get with getCharBoundaries) to this value.