Only allow numbers in an input field in AS2
If you’ve ever created a form using ActionScript 2, you know that sometimes you want to limit what characters a user can type into a given field. For example, if you’re asking the user to enter their age, or a zip code, they certainly don’t need to use letters. So you can restrict the user to only be able to type certain keys on the keyboard when they’re in that field. Here’s how:
myinputfield_txt.restrict = “0-9″;
This tells Flash to only allow the numbers 0-9 to be typed into that field.
