Construct SwitchSymbolFormatter : SwitchSymbolFormatter « 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 » SwitchSymbolFormatterScreenshots 
Construct SwitchSymbolFormatter
Construct SwitchSymbolFormatter
    

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="format()" >
  <mx:Script>
    
    import mx.formatters.SwitchSymbolFormatter;                
    
    private function format():void {
      var switchSymbolFormatter:SwitchSymbolFormatter = new SwitchSymbolFormatter("*");
      formatted.text = switchSymbolFormatter.formatValue(formatString.selectedItem..toString()"0123456789");
    }
  
  </mx:Script>

  <mx:Panel title="SwitchSymbolFormatter Example" width="400"
    height="200">

    <mx:Form>
      <mx:FormItem label="Format String:">
        <mx:ComboBox id="formatString" change="format()">
          <mx:ArrayCollection>
            <mx:String># *-********</mx:String>
            <mx:String># ----******</mx:String>
          </mx:ArrayCollection>
        </mx:ComboBox>
      </mx:FormItem>
      <mx:FormItem label="Formatted Data:">
        <mx:TextInput id="formatted" editable="false" />
      </mx:FormItem>
    </mx:Form>
  </mx:Panel>
</mx:Application>

   
    
    
    
  
Related examples in the same category
1.Formats an eight-digit number to be split by a dashFormats an eight-digit number to be split by a dash
2.Switch format string for SwitchSymbolFormatterSwitch format string for SwitchSymbolFormatter
ww_w_.j__a_va__2_s._c___o___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.