AS3 Insert and Delete Characters at TextField CaretIndex Position

/ Published in: ActionScript 3
Save to your folder(s)

This code gets the current caretIndex in the textfield and then inserts the specified string at that point. The caretIndex position is then updated using setSelection, ready for the next insertion. This was developed to be used with an on-screen keyboard (for entering text into a textfield when the user is in fullscreen mode). The backspace button is intended to function in the same manner as pressing the delete key on your keyboard.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.