Limit the input

does anyone know how to limit the input to digits only and only 2 digits are allowed, that’s could be easily done in HTML, but what about in flash?