Listen for the "keyDown" event, and the examine the
event.charCode for a value of 8 or 127 respectively.
If you want to prevent the backspace/delete, it's not so easy
- you cannot prevent propagation of the keyDown event. Here's what
I do (not pretty, but it works):
var caretOffset:uint = textField.selectionEndIndex;
if (event.charCode == 127)
This works by putting a space in the position that's about to
be deleted or backspaced over, so the end effect after the deletion
is unchanged. Because backspace also moves us back, we move the
cursor to after the inserted space.