Dynamic Text, delete numbers using btn

Hello!

I’m working on a project where the user has to enter in a game code. I have it set up as a number pad (similar to phone) so when the user clicks on “1” a 1 is typed into the dynamic text box.

I have a button on the bottom for “CLEAR” which clears out everything they’ve typed (max. characters 5)

I’m trying to figure out a way for a “back” btn to work which would just delete one number at a time on(release){…

Here is the code that has the clear button working:

on (release) {
_root.gameCodetxt = _root.gameCodetxt.length ="";

}

Any ideas???