http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/RadioButtonGroupExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/RadioButtonGroupExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/RadioButtonGroupExample.mxml new file mode 100755 index 0000000..af1f0a0 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/RadioButtonGroupExample.mxml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate RadioButtonGroup control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.controls.Alert; + import mx.events.ItemClickEvent; + + // Event handler function to display the selected button + // in an Alert control. + private function handleCard(event:ItemClickEvent):void { + if (event.currentTarget.selectedValue == "AmEx") { + Alert.show("You selected American Express") + } + else { + if (event.currentTarget.selectedValue == "MC") { + Alert.show("You selected MasterCard") + } + else { + Alert.show("You selected Visa") + } + } + } + ]]> + </fx:Script> + + <mx:Panel title="RadioButtonGroup Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10"> + + <mx:Label width="100%" color="blue" + text="Select a type of credit card."/> + + <mx:RadioButtonGroup id="cardtype" itemClick="handleCard(event);"/> + <mx:RadioButton groupName="cardtype" id="americanExpress" value="AmEx" + label="American Express" width="150" /> + <mx:RadioButton groupName="cardtype" id="masterCard" value="MC" + label="MasterCard" width="150" /> + <mx:RadioButton groupName="cardtype" id="visa" value="Visa" + label="Visa" width="150" /> + + </mx:Panel> +</mx:Application> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/RichTextEditorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/RichTextEditorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/RichTextEditorExample.mxml new file mode 100755 index 0000000..9553fca --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/RichTextEditorExample.mxml @@ -0,0 +1,32 @@ +<?xml version="1.0" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the RichTextEditor control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" + horizontalAlign="center" verticalAlign="middle"> + + <mx:RichTextEditor id="rte" title="RichTextEditor" height="75%" text="Enter text into the RichTextEditor control, then click a button to display your text as plain text, or as HTML-formatted text."/> + + <mx:TextArea id="rteText" width="80%" height="25%"/> + + <mx:HBox> + <mx:Button label="Show Plain Text" click="rteText.text=rte.text;"/> + <mx:Button label="Show HTML Markup" click="rteText.text=rte.htmlText;"/> + </mx:HBox> + +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleAlert.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleAlert.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleAlert.mxml new file mode 100755 index 0000000..1e85001 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleAlert.mxml @@ -0,0 +1,74 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Alert control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + import mx.controls.Alert; + import mx.events.CloseEvent; + + // Event handler function uses a static method to show + // a pop-up window with the title, message, and requested buttons. + private function clickHandler(event:Event):void { + Alert.show("Do you want to save your changes?", "Save Changes", 3, this, alertClickHandler); + } + + // Event handler function for displaying the selected Alert button. + private function alertClickHandler(event:CloseEvent):void { + if (event.detail==Alert.YES) + status.text="You answered Yes"; + else + status.text="You answered No"; + } + + // Event handler function changes the default Button labels and sets the + // Button widths. If you later use an Alert with the default Buttons, + // you must reset these values. + private function secondClickHandler(event:Event):void { + Alert.buttonWidth = 100; + Alert.yesLabel = "Magenta"; + Alert.noLabel = "Blue"; + Alert.cancelLabel = "Green"; + + Alert.show("Select a color:","Color Selection",1|2|8,this); + + // Set the labels back to normal: + Alert.yesLabel = "Yes"; + Alert.noLabel = "No"; + } + ]]> + </fx:Script> + + <mx:Panel title="Alert Control Example" width="75%" horizontalAlign="center" paddingTop="10"> + <mx:Text width="100%" color="blue" textAlign="center" + text="Click the button below to display a simple Alert window."/> + <mx:Button label="Click Me" click="Alert.show('Hello World!', 'Message');"/> + + <mx:Text width="100%" color="blue" textAlign="center" + text="Click the button below to display an Alert window and capture the button pressed by the user."/> + <mx:Button label="Click Me" click="clickHandler(event);"/> + <mx:Label id="status" fontWeight="bold"/> + + <mx:Text width="100%" color="blue" textAlign="center" + text="Click the button below to display an Alert window that uses custom Button labels."/> + <mx:Button label="Click Me" click="secondClickHandler(event);"/> + </mx:Panel> + +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleComboBox.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleComboBox.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleComboBox.mxml new file mode 100755 index 0000000..2474844 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleComboBox.mxml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the ComboBox control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + import mx.collections.ArrayCollection; + + [Bindable] + public var cards:ArrayCollection = new ArrayCollection( + [ {label:"Visa", data:1}, + {label:"MasterCard", data:2}, + {label:"American Express", data:3} ]); + + private function closeHandler(event:Event):void { + myLabel.text = "You selected: " + ComboBox(event.target).selectedItem.label; + myData.text = "Data: " + ComboBox(event.target).selectedItem.data; + } + ]]> + </fx:Script> + + <mx:Panel title="ComboBox Control Example" + height="75%" width="75%" layout="horizontal" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:ComboBox dataProvider="{cards}" width="150" + close="closeHandler(event);"/> + + <mx:VBox width="250"> + <mx:Text width="200" color="blue" text="Select a type of credit card."/> + <mx:Label id="myLabel" text="You selected:"/> + <mx:Label id="myData" text="Data:"/> + </mx:VBox> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleDataGrid.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleDataGrid.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleDataGrid.mxml new file mode 100755 index 0000000..5ade60d --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleDataGrid.mxml @@ -0,0 +1,78 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- DataGrid control example. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Declarations> + <fx:XMLList id="employees"> + <employee> + <name>Christina Coenraets</name> + <phone>555-219-2270</phone> + <email>ccoenra...@fictitious.com</email> + <active>true</active> + </employee> + <employee> + <name>Joanne Wall</name> + <phone>555-219-2012</phone> + <email>jw...@fictitious.com</email> + <active>true</active> + </employee> + <employee> + <name>Maurice Smith</name> + <phone>555-219-2012</phone> + <email>maur...@fictitious.com</email> + <active>false</active> + </employee> + <employee> + <name>Mary Jones</name> + <phone>555-219-2000</phone> + <email>mjo...@fictitious.com</email> + <active>true</active> + </employee> + </fx:XMLList> + </fx:Declarations> + + <mx:Panel title="DataGrid Control Example" height="100%" width="100%" + paddingTop="10" paddingLeft="10" paddingRight="10"> + + <mx:Label width="100%" color="blue" + text="Select a row in the DataGrid control."/> + + <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}"> + <mx:columns> + <mx:DataGridColumn dataField="name" headerText="Name"/> + <mx:DataGridColumn dataField="phone" headerText="Phone"/> + <mx:DataGridColumn dataField="email" headerText="Email"/> + </mx:columns> + </mx:DataGrid> + + <mx:Form width="100%" height="100%"> + <mx:FormItem label="Name"> + <mx:Label text="{dg.selectedItem.name}"/> + </mx:FormItem> + <mx:FormItem label="Email"> + <mx:Label text="{dg.selectedItem.email}"/> + </mx:FormItem> + <mx:FormItem label="Phone"> + <mx:Label text="{dg.selectedItem.phone}"/> + </mx:FormItem> + </mx:Form> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleHRule.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleHRule.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleHRule.mxml new file mode 100755 index 0000000..3205a56 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleHRule.mxml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the HRule control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Declarations> + <mx:WipeLeft id="myWL"/> + </fx:Declarations> + + <mx:Panel title="HRule Control Example" id="myPanel" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:HRule rollOverEffect="{myWL}" width="100%" strokeWidth="1" strokeColor="red"/> + <mx:Label width="100%" color="blue" + text="Move mouse over HorizontalRule control to redraw it."/> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImage.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImage.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImage.mxml new file mode 100755 index 0000000..b44524e --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImage.mxml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Image control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel id="myPanel" title="Image Control Example" + height="75%" width="75%" horizontalAlign="center" + paddingTop="10" paddingLeft="10"> + + <mx:Label color="blue" text="Image embedded in the application."/> + <mx:Image source="@Embed('assets/ApacheFlexLogo.png')"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageHSlider.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageHSlider.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageHSlider.mxml new file mode 100755 index 0000000..5ef85ea --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageHSlider.mxml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the HSlider control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + private var imageWidth:Number=0; + private var imageHeight:Number=0; + + // Event handler function to change the image size. + private function changeSize():void + { + logo.width=uint(imageWidth*hSlider.value/100); + logo.height=uint(imageHeight*hSlider.value/100); + } + ]]> + </fx:Script> + + <mx:Panel id="panel" title="HSlider Control Example" height="100%" width="95%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:HBox height="100%" width="100%"> + <mx:Image id="logo" source="@Embed('assets/ApacheFlexLogo.png')" + creationComplete="imageWidth=logo.width; imageHeight=logo.height;" /> + </mx:HBox> + + <mx:Label color="blue" text="Drag the slider to resize the image."/> + + <mx:HSlider id="hSlider" minimum="0" maximum="100" value="100" + dataTipPlacement="top" + tickColor="black" + snapInterval="1" tickInterval="10" + labels="['0%','100%']" + allowTrackClick="true" + liveDragging="true" + change="changeSize();"/> + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageVSlider.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageVSlider.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageVSlider.mxml new file mode 100755 index 0000000..2275598 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleImageVSlider.mxml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the VSlider control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + private var imageWidth:Number=0; + private var imageHeight:Number=0; + + // Event handler function to change the image size. + private function changeSize():void + { + logo.width=uint(imageWidth*hSlider.value/100); + logo.height=uint(imageHeight*hSlider.value/100); + } + ]]> + </fx:Script> + + <mx:Panel id="panel" title="VSlider Control Example" + height="100%" width="100%" + layout="horizontal" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:HBox width="50%"> + <mx:Image id="logo" source="@Embed('assets/ApacheFlexLogo.png')" + creationComplete="imageWidth=logo.width; imageHeight=logo.height;" /> + </mx:HBox> + + <mx:VBox horizontalAlign="center"> + <mx:Label color="blue" text="Drag the slider to resize the image."/> + + <mx:VSlider id="hSlider" + dataTipPlacement="top" + minimum="0" maximum="100" value="100" + tickColor="black" + snapInterval="1" tickInterval="10" + labels="['0%','100%']" + allowTrackClick="true" + liveDragging="true" + change="changeSize();"/> + </mx:VBox> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleList.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleList.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleList.mxml new file mode 100755 index 0000000..5bdbb81 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleList.mxml @@ -0,0 +1,59 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the List Control --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + [Bindable] + public var selectedItem:Object; + ]]> + </fx:Script> + + + <fx:Declarations> + <fx:Model id="mystates"> + <states> + <state label="Alabama" data="AL"/> + <state label="Alaska" data="AK"/> + <state label="Arizona" data="AZ"/> + <state label="Arkansas" data="AR"/> + <state label="California" data="CA"/> + <state label="Colorado" data="CO"/> + <state label="Connecticut" data="CT"/> + </states> + </fx:Model> + </fx:Declarations> + + <mx:Panel title="List Control Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Label text="Select a state to see its abbreviation."/> + + <mx:List id="source" width="100%" color="blue" + dataProvider="{mystates.state}" + change="this.selectedItem=List(event.target).selectedItem"/> + + <mx:VBox width="100%"> + <mx:Label text="Selected State: {selectedItem.label}"/> + <mx:Label text="State abbreviation: {selectedItem.data}"/> + </mx:VBox> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleLoader.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleLoader.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleLoader.mxml new file mode 100755 index 0000000..05da3aa --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleLoader.mxml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the SWFLoader control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="SWFLoader Control Example" height="90%" width="90%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Label text="The Label control of the outer application."/> + + <mx:SWFLoader id="Load" source="@Embed(source='Local.swf')" height="100" width="350"/> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleMenuExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleMenuExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleMenuExample.mxml new file mode 100755 index 0000000..2972010 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleMenuExample.mxml @@ -0,0 +1,72 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Menu control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.controls.Menu; + import mx.events.MenuEvent; + import mx.controls.Alert; + import flash.geom.Point; + + private var point1:Point = new Point(); + private var myMenu:Menu; + + // Create and display the Menu control. + private function showMenu():void { + myMenu= Menu.createMenu(panel, myMenuData, false); + myMenu.labelField="@label" + myMenu.addEventListener("itemClick", menuHandler); + + // Calculate position of Menu in Application's coordinates. + point1.x=mybutton.x; + point1.y=mybutton.y; + point1=mybutton.localToGlobal(point1); + + myMenu.show(point1.x + 25, point1.y + 25); + } + + // Event handler for the Menu control's change event. + private function menuHandler(event:MenuEvent):void { + Alert.show("Label: " + event.item.@label, "Clicked menu item"); + } + ]]> + </fx:Script> + + <fx:Declarations> + <fx:XML id="myMenuData"> + <root> + <menuitem label="MenuItem 1" eventName="copy"/> + <menuitem label="MenuItem 2" eventName="paste"/> + </root> + </fx:XML> + </fx:Declarations> + + <mx:Panel id="panel" title="Menu Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10"> + + <mx:Label width="100%" color="blue" + text="Click the button to open the Menu control."/> + + <mx:Button id="mybutton" label="Open Menu" click="showMenu();"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleProgressBar.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleProgressBar.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleProgressBar.mxml new file mode 100755 index 0000000..b150bf3 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleProgressBar.mxml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the ProgressBar control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + private var j:uint=10; + + // Event handler function to set the value of the + // ProgressBar control. + private function runit():void + { + if(j<=100) + { + bar.setProgress(j,100); + bar.label= "CurrentProgress" + " " + j + "%"; + j+=10; + } + if(j>100) + { + j=0; + } + } + ]]> + </fx:Script> + + <mx:Panel title="ProgressBar Control Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Label width="100%" color="blue" + text="Click the button to increment the progress bar." /> + <mx:Button id="Speed" label="Run" click="runit();"/> + + <mx:ProgressBar id="bar" labelPlacement="bottom" + minimum="0" visible="true" maximum="100" label="CurrentProgress 0%" + direction="right" mode="manual" width="100%"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleVRule.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleVRule.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleVRule.mxml new file mode 100755 index 0000000..7163151 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SimpleVRule.mxml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the VRule control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="VRule Control Example" id="myPanel" horizontalAlign="center" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:VRule rollOverEffect="WipeUp" strokeWidth="1" strokeColor="red"/> + <mx:Label width="100%" color="blue" + text="Move mouse over VRule control to redraw it."/> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/SpacerExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/SpacerExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/SpacerExample.mxml new file mode 100755 index 0000000..fd59199 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/SpacerExample.mxml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Spacer control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel id="panel" title="Spacer Control Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Text width="100%" color="blue" + text="The Spacer control pushes the second image to the right edge of the HBox container."/> + + <mx:HBox width="100%"> + <mx:Image source="@Embed('assets/ApacheFlexLogo.png')"/> + <mx:Spacer width="100%"/> + <mx:Image source="@Embed('assets/ApacheFlexLogo.png')"/> + </mx:HBox> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TabBarExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TabBarExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TabBarExample.mxml new file mode 100755 index 0000000..07de42d --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TabBarExample.mxml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the TabBar control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.events.ItemClickEvent; + import mx.controls.TabBar; + + [Bindable] + public var STATE_ARRAY:Array = [{label:"Alabama", data:"Montgomery"}, + {label:"Alaska", data:"Juneau"}, + {label:"Arkansas", data:"LittleRock"} + ]; + + private function clickEvt(event:ItemClickEvent):void { + // Access target TabBar control. + var targetComp:TabBar = TabBar(event.currentTarget); + forClick.text="label is: " + event.label + ", index is: " + + event.index + ", capital is: " + + targetComp.dataProvider[event.index].data; + } + ]]> + </fx:Script> + + <mx:Panel title="TabBar Control Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Label width="100%" color="blue" + text="Select a tab to change the current panel."/> + + <mx:TabBar itemClick="clickEvt(event);"> + <mx:dataProvider>{STATE_ARRAY}</mx:dataProvider> + </mx:TabBar> + + <mx:TextArea id="forClick" height="100%" width="100%"/> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TextAreaExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TextAreaExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TextAreaExample.mxml new file mode 100755 index 0000000..3d346f9 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TextAreaExample.mxml @@ -0,0 +1,37 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the TextArea control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="TextArea Control Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:TextArea width="400" height="100"> + <mx:text> + This is a multiline, editable TextArea control. If you need + a non-editable multiline control, use the Text control. + </mx:text> + </mx:TextArea> + + <mx:TextArea width="400" height="100"> + <mx:htmlText><![CDATA[This is <font color="#FF0000">HTML text</font> in a <b>TextArea control</b>. Use the <u>htmlText property</u> of the <font color="#008800">TextArea control</font> to include basic HTML markup in your text.]]></mx:htmlText> + </mx:TextArea> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TextExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TextExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TextExample.mxml new file mode 100755 index 0000000..11610a4 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TextExample.mxml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Text control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="Text Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10" paddingRight="10"> + + <mx:Text width="100%"> + <mx:text> + This is a multiline, non-editable text component. + If you need an editable multiline component, use TextArea. + </mx:text> + </mx:Text> + + <mx:Text width="100%"> + <mx:htmlText> + <![CDATA[This is <font color="#FF0000">HTML text</font> in a <b>Text component</b>. Using the <u>htmlText attribute</u> of the <font color="#008800">Text component</font> you can use basic HTML markup.]]> + </mx:htmlText> + </mx:Text> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TextInputExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TextInputExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TextInputExample.mxml new file mode 100755 index 0000000..d47364e --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TextInputExample.mxml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the TextInput control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="TextInput Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10"> + + <mx:TextInput id="src" text="Hello World!"/> + + <mx:Button label="Copy Text" click="dest.text = src.text"/> + + <mx:TextInput id="dest"/> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TileListExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TileListExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TileListExample.mxml new file mode 100755 index 0000000..6914889 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TileListExample.mxml @@ -0,0 +1,68 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the TileList Control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + [Bindable] + [Embed(source="assets/ApacheFlexLogo.png")] + public var logo1:Class; + + [Bindable] + [Embed(source="assets/ApacheFlexLogo.png")] + public var logo2:Class; + + [Bindable] + [Embed(source="assets/ApacheFlexLogo.png")] + public var logo3:Class; + + [Bindable] + [Embed(source="assets/ApacheFlexLogo.png")] + public var logo4:Class; + + [Bindable] + [Embed(source="assets/ApacheFlexLogo.png")] + public var logo5:Class; + ]]> + </fx:Script> + + <mx:Panel title="TileList Control Example" height="100%" width="100%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:Label width="100%" color="blue" + text="A TileList control displays items in rows and columns."/> + + <mx:TileList id="CameraSelection" height="250" width="300" + maxColumns="2" rowHeight="225" columnWidth="125"> + <mx:dataProvider> + <fx:Array> + <fx:Object label="Logo 1" icon="{logo1}"/> + <fx:Object label="Logo 2" icon="{logo2}"/> + <fx:Object label="Logo 3" icon="{logo3}"/> + <fx:Object label="Logo 4" icon="{logo4}"/> + <fx:Object label="Logo 5" icon="{logo5}"/> + </fx:Array> + </mx:dataProvider> + </mx:TileList> + + </mx:Panel> +</mx:Application> + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/ToggleButtonBarExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/ToggleButtonBarExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/ToggleButtonBarExample.mxml new file mode 100755 index 0000000..32a5c3a --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/ToggleButtonBarExample.mxml @@ -0,0 +1,55 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the ToggleButtonBar control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.events.ItemClickEvent; + + // Event handler function to print a message + // describing the selected Button control. + private function clickHandler(event:ItemClickEvent):void { + myTA.text="Selected button index: " + String(event.index) + + "\n" + "Selected button label: " + event.label; + } + ]]> + </fx:Script> + + <mx:Panel title="ToggleButtonBar Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Label width="100%" color="blue" + text="Select a button in the ToggleButtonBar control."/> + + <mx:TextArea id="myTA" width="100%" height="100%"/> + + <mx:ToggleButtonBar itemClick="clickHandler(event);"> + <mx:dataProvider> + <fx:Array> + <fx:String>Flex SDK</fx:String> + <fx:String>Flex JS</fx:String> + <fx:String>Falcon</fx:String> + <fx:String>Falcon JX</fx:String> + </fx:Array> + </mx:dataProvider> + </mx:ToggleButtonBar> + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/TreeExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/TreeExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/TreeExample.mxml new file mode 100755 index 0000000..528db0d --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/TreeExample.mxml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Tree control example. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + [Bindable] + public var selectedNode:XML; + + // Event handler for the Tree control change event. + public function treeChanged(event:Event):void { + selectedNode=Tree(event.target).selectedItem as XML; + } + ]]> + </fx:Script> + + <fx:Declarations> + <fx:XMLList id="treeData"> + <node label="Mail Box"> + <node label="Inbox"> + <node label="Marketing"/> + <node label="Product Management"/> + <node label="Personal"/> + </node> + <node label="Outbox"> + <node label="Professional"/> + <node label="Personal"/> + </node> + <node label="Spam"/> + <node label="Sent"/> + </node> + </fx:XMLList> + </fx:Declarations> + + <mx:Panel title="Tree Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Label width="100%" color="blue" + text="Select a node in the Tree control."/> + + <mx:HDividedBox width="100%" height="100%"> + <mx:Tree id="myTree" width="50%" height="100%" labelField="@label" + showRoot="false" dataProvider="{treeData}" change="treeChanged(event)"/> + <mx:TextArea height="100%" width="50%" + text="Selected Item: {selectedNode.@label}"/> + </mx:HDividedBox> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/VScrollBarExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/VScrollBarExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/VScrollBarExample.mxml new file mode 100755 index 0000000..682eda7 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/VScrollBarExample.mxml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the VScrollBar control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.events.ScrollEvent; + + // Event handler function to display the scroll location + // as you move the scroll thumb. + private function myScroll(event:ScrollEvent):void + { + showPosition.text = "VScrollBar properties summary:" + '\n' + + "------------------------------------" + '\n' + + "Current scroll position: " + event.currentTarget.scrollPosition + '\n' + + "The maximum scroll position: " + event.currentTarget.maxScrollPosition + '\n' + + "The minimum scroll position: " + event.currentTarget.minScrollPosition ; + } + ]]> + </fx:Script> + + <mx:Panel id="panel" title="VScrollBar Control Example" height="75%" width="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Label width="100%" color="blue" + text="Click on the scroll bar to view its properties."/> + + <mx:VScrollBar id="bar" height="100%" + minScrollPosition="0" maxScrollPosition="{panel.width - 20}" + lineScrollSize="50" pageScrollSize="100" + repeatDelay="1000" repeatInterval="500" + scroll="myScroll(event);"/> + + <mx:TextArea height="100%" width="100%" id="showPosition" color="blue"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/VideoDisplayExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/VideoDisplayExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/controls/VideoDisplayExample.mxml new file mode 100755 index 0000000..a641674 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/controls/VideoDisplayExample.mxml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the VideoDisplay control. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <mx:Panel title="VideoDisplay Control Example" height="75%" width="75%" + horizontalAlign="center" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="75%" color="blue" + text="Use the buttons to control the video. The Stop button resets the video to the beginning."/> + + <mx:VideoDisplay id="myVid" height="158" width="211" source="assets/FlexInstaller.mp4" autoPlay="false"/> + + <mx:HBox> + <mx:Button label="Play" click="myVid.play();"/> + <mx:Button label="Pause" click="myVid.pause();"/> + <mx:Button label="Stop" click="myVid.stop();"/> + </mx:HBox> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexIcon.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexIcon.png b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexIcon.png new file mode 100644 index 0000000..e68d831 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexIcon.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexLogo.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexLogo.png b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexLogo.png new file mode 100644 index 0000000..4ff037f Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/ApacheFlexLogo.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDisabled.gif ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDisabled.gif b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDisabled.gif new file mode 100755 index 0000000..9a19d26 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDisabled.gif differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDown.gif ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDown.gif b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDown.gif new file mode 100755 index 0000000..18c0ea4 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonDown.gif differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonOver.gif ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonOver.gif b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonOver.gif new file mode 100755 index 0000000..9c66b81 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonOver.gif differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonUp.gif ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonUp.gif b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonUp.gif new file mode 100755 index 0000000..36dfb34 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/buttonUp.gif differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/controls/assets/flexinstaller.mp4 ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/controls/assets/flexinstaller.mp4 b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/flexinstaller.mp4 new file mode 100644 index 0000000..8c877c4 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/mx/controls/assets/flexinstaller.mp4 differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/core/RepeaterExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/core/RepeaterExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/core/RepeaterExample.mxml new file mode 100755 index 0000000..12da883 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/core/RepeaterExample.mxml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Repeater class. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.controls.Alert; + + [Bindable] + private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + + ]]> + </fx:Script> + + <mx:Panel title="Repeater Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="100%" color="blue" + text="Use the Repeater class to create 9 Button controls in a 3 by 3 Tile container."/> + + <mx:Tile direction="horizontal" borderStyle="inset" + horizontalGap="10" verticalGap="15" + paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10"> + + <mx:Repeater id="rp" dataProvider="{dp}"> + <mx:Button height="49" width="50" + label="{String(rp.currentItem)}" + click="Alert.show(String(event.currentTarget.getRepeaterItem()) + ' pressed')"/> + </mx:Repeater> + </mx:Tile> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/core/SimpleApplicationExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/core/SimpleApplicationExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/core/SimpleApplicationExample.mxml new file mode 100755 index 0000000..3b1055e --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/core/SimpleApplicationExample.mxml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Application container. --> + +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" + backgroundColor="0xCCCCCC" + horizontalAlign="center" verticalAlign="middle" + applicationComplete="appComplete();"> + + <fx:Script> + <![CDATA[ + + // Event handlers for the components. + private function appComplete():void { + myTA.text+="Application creation complete" + "\n"; + } + + private function panelCreationComplete():void { + myTA.text+="Panel creation complete" + "\n"; + } + + private function textAreaCreationComplete():void { + myTA.text+="\n" + "TextArea creation complete" + "\n"; + } + ]]> + </fx:Script> + + <mx:ApplicationControlBar dock="true"> + <mx:Button label="Set Grey Solid Fill" + click="this.setStyle('backgroundColor', 0xCCCCCC);"/> + <mx:Button label="Set Blue Solid Fill" + click="this.setStyle('backgroundColor', 0x66CCFF);"/> + </mx:ApplicationControlBar> + + <mx:Panel title="Application Container Example" backgroundColor="0x9CB0BA" + width="75%" height="75%" + creationComplete="panelCreationComplete();"> + + <mx:TextArea id="myTA" height="100%" width="100%" + text="Event order: " + creationComplete="textAreaCreationComplete();"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/effects/AddItemActionEffectExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/effects/AddItemActionEffectExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/effects/AddItemActionEffectExample.mxml new file mode 100755 index 0000000..1b15899 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/effects/AddItemActionEffectExample.mxml @@ -0,0 +1,100 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + import mx.effects.easing.Elastic; + import mx.collections.ArrayCollection; + + [Bindable] + private var myDP:ArrayCollection = new ArrayCollection( + ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P']); + + private function deleteItem():void { + // As each item is removed, the index of the other items changes. + // So first get the items to delete, then determine their indices + // as you remove them. + var toRemove:Array = []; + for (var i:int = 0; i < tlist0.selectedItems.length; i++) + toRemove.push(tlist0.selectedItems[i]); + for (i = 0; i < toRemove.length; i++) + myDP.removeItemAt(myDP.getItemIndex(toRemove[i])); + } + + private var zcount:int = 0; + private function addItem():void { + // Always add the new item after the third item, + // or after the last item if the length is less than 3. + myDP.addItemAt("Z"+zcount++,Math.min(3,myDP.length)); + } + ]]> + </fx:Script> + + <fx:Declarations> + <!-- Define a custom data effect as a Sequence effect. --> + <mx:Sequence id="itemsChangeEffect1"> + <mx:Blur + blurYTo="12" blurXTo="12" + duration="300" + perElementOffset="150" + filter="removeItem"/> + <mx:Parallel> + <mx:Move + duration="750" + easingFunction="{Elastic.easeOut}" + perElementOffset="20"/> + <mx:RemoveItemAction + startDelay="400" + filter="removeItem"/> + <mx:AddItemAction + startDelay="400" + filter="addItem"/> + <mx:Blur + startDelay="410" + blurXFrom="18" blurYFrom="18" blurXTo="0" blurYTo="0" + duration="300" + filter="addItem"/> + </mx:Parallel> + </mx:Sequence> + </fx:Declarations> + + <mx:Panel title="AddItemEffect/RemoveItemEffect Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <!-- This TileList uses a custom data change effect --> + <mx:TileList id="tlist0" + height="100%" width="100%" + fontSize="18" fontWeight="bold" + columnCount="4" rowCount="4" + direction="horizontal" + dataProvider="{myDP}" + allowMultipleSelection="true" + offscreenExtraRowsOrColumns="4" + itemsChangeEffect="{itemsChangeEffect1}"/> + + <mx:Button + label="Delete selected item(s)" + click="deleteItem();"/> + <mx:Button + label="Add item" + click="addItem();"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/effects/AnimatePropertyEffectExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/effects/AnimatePropertyEffectExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/effects/AnimatePropertyEffectExample.mxml new file mode 100755 index 0000000..50cde02 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/effects/AnimatePropertyEffectExample.mxml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the AnimateProperty effect. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Declarations> + <mx:Sequence id="animateScaleXUpDown" > + <mx:AnimateProperty property="scaleX" fromValue="1" toValue="1.5" duration="1000" /> + <mx:AnimateProperty property="scaleX" fromValue="1.5" toValue="1" duration="1000" /> + </mx:Sequence> + </fx:Declarations> + + <mx:Panel title="AnimateProperty Effect Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="100%" color="blue" + text="Click on the image to use the AnimateProperty effect with the scaleX property."/> + + <mx:Image id="flex" source="@Embed(source='assets/ApacheFlexLogo.png')" + mouseDownEffect="{animateScaleXUpDown}"/> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/effects/BlurEffectExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/effects/BlurEffectExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/effects/BlurEffectExample.mxml new file mode 100755 index 0000000..e1c86a6 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/effects/BlurEffectExample.mxml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Blur effect. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Declarations> + <mx:Blur id="blurImage" duration="1000" + blurXFrom="0.0" blurXTo="10.0" + blurYFrom="0.0" blurYTo="10.0"/> + <mx:Blur id="unblurImage" duration="1000" + blurXFrom="10.0" blurXTo="0.0" + blurYFrom="10.0" blurYTo="0.0"/> + </fx:Declarations> + + <mx:Panel title="Blur Effect Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="100%" color="blue" + text="Click and hold the mouse on the image to see blurImage effect. Release the mouse to see the unblurImage effect."/> + + <mx:Image id="flex" source="@Embed(source='assets/ApacheFlexLogo.png')" + mouseDownEffect="{blurImage}" + mouseUpEffect="{unblurImage}"/> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/effects/CompositeEffectExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/effects/CompositeEffectExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/effects/CompositeEffectExample.mxml new file mode 100755 index 0000000..351a0d5 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/effects/CompositeEffectExample.mxml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<!-- Simple example to demonstrate the Composite effect. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + import mx.effects.Move; + import mx.effects.Sequence; + import mx.effects.Parallel; + + private var movesequenceA:Move; + private var movesequenceB:Move; + private var moveparallelbutton:Move; + private var sequenceAB:Sequence; + private var parallelAB:Parallel; + + private function startEffect(ax:Number, ay:Number, bx:Number, by:Number):void + { + movesequenceA= new Move(a); + movesequenceB= new Move(b); + moveparallelbutton= new Move(button); + sequenceAB= new Sequence(); + parallelAB= new Parallel(); + + sequenceAB.addChild(movesequenceA); + sequenceAB.addChild(movesequenceB); + + parallelAB.addChild(moveparallelbutton); + + moveparallelbutton.xTo=0; + moveparallelbutton.xFrom= 245; + moveparallelbutton.yFrom=85; + moveparallelbutton.duration= 4000; + + movesequenceA.xTo= ax; + movesequenceA.xBy= 200; + movesequenceA.yTo= ay; + movesequenceA.yBy= 175; + movesequenceA.duration= 2000; + movesequenceB.yFrom =175; + movesequenceB.xTo= bx; + movesequenceB.xBy= 200; + movesequenceB.yTo= by; + movesequenceB.yBy= 200; + movesequenceB.duration= 2000; + + sequenceAB.play(); + parallelAB.play(); + } + ]]> + </fx:Script> + + <mx:Panel title="Composite Effect" width="75%" height="75%"> + <mx:Canvas id="canvas" width="100%" height="100%"> + + <mx:Label id="a" color="#009966" text="Sequence 1" + height="{(canvas.height-20)/2}" + width="{(canvas.width-20)/2}" + effectStart=" a.text= 'sequence 1 Running';" + effectEnd="a.text='sequence 1 ended!!!' "/> + + <mx:Label id="b" x="0" y="175" color="#00CCFF" + text="Sequence 2" + height="{(canvas.height-20)/2}" + width="{(canvas.width-20)/2}" + effectStart=" b.text= 'sequence 2 Running';" + effectEnd="b.text='sequence 2 ended!!'" /> + + <mx:Button id="button" x="245" y="85" + label="Start effect" + click="startEffect(200,175,200,0)" + effectStart="button.label='parallel effect running'" + effectEnd="button.label='parallel effect ended!!'"/> + + </mx:Canvas> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/effects/DefaultListEffectExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/effects/DefaultListEffectExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/effects/DefaultListEffectExample.mxml new file mode 100755 index 0000000..3e41a38 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/effects/DefaultListEffectExample.mxml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + import mx.effects.DefaultListEffect; + import mx.collections.ArrayCollection; + + [Bindable] + private var myDP:ArrayCollection = new ArrayCollection( + ['A','B','C','D','E','F','G','H']); + + private function deleteItem():void { + // As each item is removed, the index of the other items changes. + // So first get the items to delete, then determine their indices + // as you remove them. + var toRemove:Array = []; + for (var i:int = 0; i < list0.selectedItems.length; i++) + toRemove.push(list0.selectedItems[i]); + for (i = 0; i < toRemove.length; i++) + myDP.removeItemAt(myDP.getItemIndex(toRemove[i])); + } + + private var zcount:int = 0; + private function addItem():void { + // Always add the new item after the third item, + // or after the last item if the length is less than 3. + myDP.addItemAt("Z"+zcount++,Math.min(3,myDP.length)); + } + ]]> + </fx:Script> + + <fx:Declarations> + <!-- Define an instance of the DefaultListEffect effect, + and set its fadeOutDuration and color properties. --> + <mx:DefaultListEffect id="myDLE" + fadeOutDuration="1000" + color="0x0000ff"/> + </fx:Declarations> + + <mx:Panel title="DefaultListEffect Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:List id="list0" + width="150" + dataProvider="{myDP}" + variableRowHeight="true" + fontSize="18" + allowMultipleSelection="true" + itemsChangeEffect="{myDLE}"/> + + <mx:Button + label="Delete item" + click="deleteItem();"/> + <mx:Button + label="Add item" + click="addItem();"/> + + </mx:Panel> +</mx:Application> \ No newline at end of file