If you want to only show numeric characters in a textfield in Flash ActionScript 2, you can use the restrict property:

myTextField.restrict = "0-9";

This tells Flash to only allow digits 0 through 9 in the text field. Any other characters the user types will simply be ignored.

You can extend this pattern for other use cases too. For example, to allow decimal numbers use "0-9.", or for hex input use "0-9A-Fa-f". If you need to allow negative numbers, add a hyphen: "0-9\\-" (the backslash escapes the hyphen so it’s treated as a literal character rather than a range).

This is the ActionScript 2 equivalent of HTML’s <input type="number"> — a simple way to enforce input validation at the UI level. You should still validate the data on the server side, but restricting input in the textfield gives users immediate feedback.