Backspace/Delete Actonscript

Does anyone have the actionscript to put onto a button that will delete the last character entered? so if I entered “Yest” but wanted to delete the t so it read “yes” would this be possible?