Say, you need to create a text field for phone numbers and you need to restrict every symbol but numbers. This question is asked alot, although the solution in Actionscript 3 is pretty simple:
The above code lets the user only write numbers in the field. Here's an example of using this method:
onlyCapitals.restrict="A-Z" onlyNumbers.restrict="0-9" onlyLetters.restrict="a-zA-Z"