Custom formatting function accepts a formatting pattern : ZipCodeFormatter « Data Model « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Data Model » ZipCodeFormatterScreenshots 
Custom formatting function accepts a formatting pattern
Custom formatting function accepts a formatting pattern
         

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.formatters.*;
        
        public var fmtZip:ZipCodeFormatter = new ZipCodeFormatter();

        public function formatThis(plainText:String,formatString:String):String
        {
            fmtZip.formatString = formatString;
            return(fmtZip.format(plainText));
        }
      
    </mx:Script>
    <mx:Label text="U.S Zip Code: {formatThis('12345','#####')}" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Using ZipCodeFormatter to format a 5+4 ZIP CodeUsing ZipCodeFormatter to format a 5+4 ZIP Code
2.Format input with ZipCodeFormatterFormat input with ZipCodeFormatter
w_w___w__.___j__a_v__a2_s__.___co_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.