topical media & game development

talk show tell print

professional-flex-code-12-Birthdate.mx

professional-flex-code-12-Birthdate.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:comps="*"
      creationComplete="init()">
    <mx:Script>
      <![CDATA[      
        [Bindable]
        private var days:Array = new Array();
           
        [Bindable]
        private var years:Array = new Array();
           
        private function init():void{
          for(var i:int=1; i<=31; i++){
            this.days.push(i);
          }
          for(var j:int=1950; j<=2006; j++){
            this.years.push(j);
          }
          this.daysCB.selectedIndex=1;
          this.yearsCB.selectedIndex=30;
        }
           
        [Bindable]
        public var labelFieldVar:String = "full";
           
        public function getBirthdate():Date{
            return new Date(this.yearsCB.selectedItem,this.monthsCB.selectedItem['num']-1,this.daysCB.selectedItem);
        }
      ]]>
    </mx:Script>
    <comps:professional_flex_code_12_AdvancedMonths id="monthsCB" labelField="{this.labelFieldVar}"/>
    <mx:ComboBox id="daysCB" dataProvider="{this.days}" width="50"/>
    <mx:ComboBox id="yearsCB" dataProvider="{this.years}" width="65"/>
  </mx:HBox>
  


(C) Æliens 04/09/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.