diff --git a/03f4-multiple-composite-components/Main.mxml b/03f4-multiple-composite-components/Main.mxml new file mode 100644 index 0000000..7798d9f --- /dev/null +++ b/03f4-multiple-composite-components/Main.mxml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/03f4-multiple-composite-components/components/ComboBoxDateEntry.mxml b/03f4-multiple-composite-components/components/ComboBoxDateEntry.mxml new file mode 100644 index 0000000..d0089d1 --- /dev/null +++ b/03f4-multiple-composite-components/components/ComboBoxDateEntry.mxml @@ -0,0 +1,82 @@ + + + + + + + + + + + diff --git a/03f4-multiple-composite-components/components/ComboBoxMonths.as b/03f4-multiple-composite-components/components/ComboBoxMonths.as new file mode 100644 index 0000000..bbbfb11 --- /dev/null +++ b/03f4-multiple-composite-components/components/ComboBoxMonths.as @@ -0,0 +1,53 @@ +package components +{ + import mx.controls.ComboBox; + import mx.formatters.DateFormatter; + /* + ////////////////////////////////////////////////////////////////////////////// + // ADOBE SYSTEMS INCORPORATED + // Copyright 2007 Adobe Systems Incorporated + // All Rights Reserved. + // + // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the + // terms of the Adobe license agreement accompanying it. If you have received this file from a + // source other than Adobe, then your use, modification, or distribution of it requires the prior + // written permission of Adobe. + //////////////////////////////////////////////////////////////////////////////// + */ + public class ComboBoxMonths extends ComboBox + { + private var months:Array = new Array(); + private var dateformatter:DateFormatter = new DateFormatter(); + + public function ComboBoxMonths() + { + super(); + init(); + + } + + private function init():void{ + var i:int; + //get the date + var now:Date = new Date(); + //set current month + var currentMonth:int = now.getMonth(); + //format the string to show only the month + dateformatter.formatString = "MMMM"; + + //loop 12 times + for (i=0; i<12; i++){ + //change the month of the date + now.setMonth(i); + //poplate the array with the month string + months[i] = dateformatter.format(now); + } + + //set the array as the dataprovider of this combobox + this.dataProvider = months; + //select current month + this.selectedIndex = currentMonth; + } + + } +} \ No newline at end of file diff --git a/targets.mk b/targets.mk index 62cd5bc..3bec8ad 100644 --- a/targets.mk +++ b/targets.mk @@ -167,6 +167,10 @@ $(MXMLC) 03f3-composite-component/ComponentForm.mxml -warnings -l+=03f3-composite-component -output 03f3-composite-component/ComponentForm.swf +03f4-multiple-composite-components/Main.swf: 03f4-multiple-composite-components/Main.mxml 03f4-multiple-composite-components/components/ComboBoxDateEntry.mxml 03f4-multiple-composite-components/components/ComboBoxMonths.as + $(MXMLC) 03f4-multiple-composite-components/Main.mxml -warnings -l+=03f4-multiple-composite-components -output 03f4-multiple-composite-components/Main.swf + + custom-03d1-datagrid/Snarf.swf: custom-03d1-datagrid/Snarf.mxml custom-03d1-datagrid/CustomApp.as $(MXMLC) custom-03d1-datagrid/Snarf.mxml -warnings -l+=custom-03d1-datagrid -output custom-03d1-datagrid/Snarf.swf