Using the StringValidator class
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Form id="membershipForm"> <mx:FormItem id="fullNameItem" label="Full Name"> <mx:TextInput id="fullNameInput" /> </mx:FormItem> <mx:FormItem id="userNameItem" label="Username"> <mx:TextInput id="userNameInput" /> </mx:FormItem> </mx:Form> <mx:StringValidator source="{userNameInput}" property="text" minLength="6" maxLength="12" /> </mx:Application>