Global Function, validation for text field range

Hello all. I am putting together a file that has a lot of text input fields. These fields are scattered through multiple movie clips within the main project.

What I am trying to do is to validate that each of them are in a particular value range. So for the first one, I placed this code:

myMovieClip.addEventListener( FocusEvent.FOCUS_OUT, MyValidationFunction );

function MyValidationFunction( event:Event ):void{
var sString:String = targetInputField.text;
var vValue = Number(sString);
if (rangeLow <= 1 || rangeHigh >= 10){
trace (“out of range”)
} else {
trace (“value is valid”)
}
}

The code works fine and operates well. However, that is one out of about 25 fields I’ll need to apply the validation to. In each instance, the ranges will need to change as well as the text field (targetInputField) of course.

Rather than applying that code throughout the project, it seems likely to me that a more streamlined global function could be written. I tried to both write one and search for one, but I am just not strong enough with AS3 to pull it off. If anyone could provide some advice on how to do that, I would be very grateful.

Thank you very much,
Keith