# Character position or input override

**URL:** <https://forum.kirupa.com/t/character-position-or-input-override/53743>\
**Category:** Uncategorized\
**Created:** [June 7, 2004, 3:31pm UTC](https://forum.kirupa.com/t/character-position-or-input-override/53743 "2004-06-07T15:31:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giggly](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@giggly](https://forum.kirupa.com/u/giggly)\
**Post date:** [June 7, 2004, 3:31pm UTC](https://forum.kirupa.com/t/character-position-or-input-override/53743/1 "2004-06-07T15:31:53Z")

</div>

I’m kind of new to flash, so bear with me if this is a stupid question:

I want to know what character in a dynamic text field is closest to a given position. That is apparently possible with static fields through TextSnapShot, but I don’t see how to do it with dynamic fields.

The problem I am trying to solve is to intercept whatever key the user presses and add a different character to the dtf (1-1 mapping between what they press and what I show). The snapshot-style position would be useful for making a pretend cursor on a pretend input text field, then calling replaceText based on the dtf where that cursor is.

Is there a way to do that? I think I could do it with a separate text field for each character and a global String to store the full variable, although I’m not sure how I will know the “nearest character” for the cursor in that model.

Thanks for the help.
