topical media & game development

talk show tell print

lib-flex-style-explorer-components-trueFalsePicker.mx

lib-flex-style-explorer-components-trueFalsePicker.mx (swf ) [ flash ] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:FormItem xmlns:mx="http://www.adobe.com/2006/mxml" label="{pickerLabel}" width="100%" creationComplete="setDefault()" >
          
          <mx:CheckBox id="myCheckBox" selected="{styleValue}" 
                  click="styleValue = event.target.selected; dispatchMyEvent();" label="{stateLabel}" />
          
          <mx:Script>
                  <![CDATA[
                  
                          import mx.events.FlexEvent;
                          
                          [Bindable]
                          public var styleValue:Boolean = true;
                  
                          [Bindable]
                          public var pickerLabel:String;
                          
                          [Bindable]
                          public var stateLabel:String;
                  
                          private function dispatchMyEvent():void {
                  this.dispatchEvent( new Event("dataChange") );
              }
              
               [Bindable]
                          public var defaultValue:Boolean;
             
             public function setDefault():void {
                             defaultValue = styleValue;
             }
             
             public function restoreDefault():void {
                             styleValue = defaultValue;
             }
                  ]]>
          </mx:Script>
          
          <mx:Metadata>
          [Event("dataChange")]
      </mx:Metadata>
     
  </mx:FormItem>
  


(C) Æliens 18/6/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.