Restrict text input to certain characters

Create four TextInput boxes on your stage.
Give the first an instance name of tLetters.
Give the second an instance name of tNumbers.
Give the third an instance name of tCaps.
Give the last an instance name of tSymbols.


//allows only defined characters in the textboxes.
tLetters.restrict="a-z A-Z";

//notice that the "-" and "^" symbol must be between "\\" and "\\" in order to be recognized in the string
tSymbols.restrict= "! @ # $ % & ( ) _ + * / = \\-\\ \\^\\ ";


Get Adobe Flash player

Leave a Reply