Use PhoneNumberValidator to validate and PhoneFormatter to format
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" minWidth="1024" minHeight="768"> <mx:PhoneNumberValidator id="phoneValidator" property="text" source="{inputPhone}"/> <mx:PhoneFormatter id="phoneFormatter" formatString="(###) ###-####" validPatternChars="#-() "/> <mx:Script> import mx.events.ValidationResultEvent; private var vResult:ValidationResultEvent; private function phoneFormat():void { vResult = phoneValidator.validate(); if (vResult.type==ValidationResultEvent.VALID) { inputPhone.text = phoneFormatter.format(inputPhone.text); } else { inputPhone.text= ""; } } </mx:Script> <mx:Label text="Phone Number Input"/> <mx:TextInput id="inputPhone" focusOut="phoneFormat()" width="300"/> </mx:Application>