Use ZipCodeFormatter to format variable
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:ZipCodeFormatter id="ZipCodeDisplay" formatString="#####-####" /> <mx:Script> private var s:Number=123456789; </mx:Script> <mx:Panel title="My Application" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:TextInput text="{ZipCodeDisplay.format(s)}" /> </mx:Panel> </mx:Application>