You can't really apply it to the field they are typing to. You could, if you removed the Validator in this example, but it moves the cursor, and is just unusable. You're welcome to try. Here's a modified example from the help docs.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> <![CDATA[ import mx.events.ValidationResultEvent; private var vResult:ValidationResultEvent; // Event handler to validate and format input. private function format():void { vResult = numVal.validate(); if(vResult.type==ValidationResultEvent.VALID) { var temp:Number=Number(priceUS.text); formattedResult_lbl.text= usdFormatter.format(temp); } else { formattedResult_lbl.text = ""; } } ]]> </mx:Script> <mx:CurrencyFormatter id="usdFormatter" precision="2" currencySymbol="$" decimalSeparatorFrom="." decimalSeparatorTo="." useNegativeSign="true" useThousandsSeparator="true" thousandsSeparatorFrom="," thousandsSeparatorTo="," alignSymbol="left"/> <mx:NumberValidator id="numVal" source="{priceUS}" property="text" allowNegative="true" domain="real"/> <mx:TextInput id="priceUS" change="format()" focusOut="format()"/> <mx:Label id="formattedResult_lbl" /> </mx:Application> ----- Original Message ----- From: "Tom Fitzpatrick" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Monday, July 10, 2006 3:56 PM Subject: [flexcoders] Text input live formatting Is there a way to apply number formatting (e.g., thousands separator) to a text input while the user is typing the number? Thanks. - Tom -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

