| <?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. |
| |
| --> |
| <s:Application |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:comps="comps.*" |
| backgroundColor="0xFFFFFF" |
| width="550" height="700" |
| creationComplete="createAsCB()"> |
| |
| <s:layout> |
| <s:VerticalLayout/> |
| </s:layout> |
| |
| <fx:Style> |
| @namespace s "library://ns.adobe.com/flex/spark"; |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf"); |
| fontFamily: myVera; |
| embedAsCFF: true; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf"); |
| fontWeight: bold; |
| fontFamily: myVera; |
| embedAsCFF: true; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf"); |
| fontStyle: italic; |
| fontFamily: myVera; |
| embedAsCFF: true; |
| } |
| |
| global{ |
| fontAntiAliasType: "normal"; |
| fontFamily: myVera; |
| fontLookup: "embeddedCFF"; |
| } |
| </fx:Style> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayCollection; |
| |
| public var myTL_Array:Array = |
| [ |
| "Item n0", |
| "From n1", |
| "New n2", |
| "Array n3", |
| "To n4", |
| "Test n5", |
| "Adding n6", |
| ]; |
| |
| public var myAsDP_Array:Array = |
| [ |
| "First Item n0", |
| "From My n1", |
| "Array for n2", |
| "a CB created n3", |
| "in ActionScript n4", |
| "Only in order n5", |
| "to verify that capability n6", |
| ]; |
| |
| [Bindable] |
| public var myTL_AC:ArrayCollection = new ArrayCollection(myTL_Array); |
| |
| [Bindable] |
| public var myAsDP:ArrayCollection = new ArrayCollection(myAsDP_Array); |
| |
| public function createAsCB():void |
| { |
| var asCB:ComboBox = new ComboBox(); |
| asCB.width = 100; |
| asCB.dataProvider = myAsDP; |
| addElement(asCB); |
| } |
| ]]> |
| </fx:Script> |
| |
| <s:ComboBox id="myCB" dataProvider="{myTL_AC}"/> |
| <s:Label id="myCB_Label" text="selectedIndex={myCB.selectedIndex} selectedItem={myCB.selectedItem}"/> |
| |
| <s:VGroup paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5" id="focusBox"> |
| <comps:Custom_CB1 id="myCB1"/> |
| </s:VGroup> |
| <s:Label id="myCB1_Label" text="selectedIndex={myCB1.selectedIndex} selectedItem={myCB1.selectedItem}"/> |
| |
| <comps:Custom_CB2 id="myCB2" /> |
| <s:Label id="myCB2_indexLabel" text="selectedIndex={myCB2.selectedIndex}"/> |
| <s:Label id="myCB2_itemLabel" text="selectedItem={myCB2.selectedItem}"/> |
| |
| <comps:Custom_CB3 id="myCB3" /> |
| <s:Label id="myCB3_Label" text="selectedIndex={myCB3.selectedIndex} selectedItem={myCB3.selectedItem}"/> |
| |
| <s:HGroup> |
| <comps:Custom_CB4H id="myCB4H" /> |
| <comps:Custom_CB4T id="myCB4T" /> |
| </s:HGroup> |
| |
| <s:Label id="myCB4H_Label" text="selectedIndex={myCB4H.selectedIndex} selectedItem={myCB4H.selectedItem}"/> |
| <s:Label id="myCB4T_Label" text="selectedIndex={myCB4T.selectedIndex} selectedItem={myCB4T.selectedItem}"/> |
| |
| <comps:Custom_CB5 id="myCB5" /> |
| <s:Label id="myCB5_Label" text="selectedIndex={myCB5.selectedIndex} selectedItem={myCB5.selectedItem}"/> |
| |
| <comps:Custom_CB6 id="myCB6" /> |
| <s:Label id="myCB6_Label" text="selectedIndex={myCB6.selectedIndex} selectedItem={myCB6.selectedItem}"/> |
| |
| <s:HGroup> |
| <comps:Custom_CB7 id="myCB7" /> |
| <s:Button id="myBtn1" chromeColor="blue" label="Set selectedIndex=2" click="myCB7.selectedIndex=2"/> |
| </s:HGroup> |
| <s:Label id="myCB7_Label" text="selectedIndex={myCB7.selectedIndex} selectedItem={myCB7.selectedItem}"/> |
| |
| <s:HGroup> |
| <comps:Custom_CB8 id="myCB8" /> |
| <s:Button id="myBtn2" chromeColor="blue" label="Set selectedItem=Two" click="myCB8.selectedItem='Two'"/> |
| </s:HGroup> |
| <s:Label id="myCB8_Label" text="selectedIndex={myCB8.selectedIndex} selectedItem={myCB8.selectedItem}"/> |
| |
| <s:HGroup> |
| <s:NumericStepper id="myNS" minimum="-1" maximum="22" value="-1"/> |
| <comps:Custom_CB9 id="myCB9" selectedIndex="{myNS.value}"/> |
| </s:HGroup> |
| <s:Label id="myCB9_Label" text="selectedIndex={myCB9.selectedIndex} selectedItem={myCB9.selectedItem}"/> |
| |
| <comps:Custom_CB10 id="myCB10"/> |
| |
| </s:Application> |