Data Model Flex



    
        
        [Bindable]
        public var rawPhone:String = "1234567";
        public function formatThis(plainText:String):String
        {
            if(plainText.length == 7)
                fmtPhone.formatString = "###-####";
            else
                fmtPhone.formatString = "###-###-####";
            return(fmtPhone.format(plainText));
        }