| <?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. |
| |
| --> |
| <basic:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:basic="library://ns.apache.org/flexjs/basic" |
| > |
| <fx:Script> |
| <![CDATA[ |
| import org.apache.flex.events.CustomEvent; |
| import org.apache.flex.events.Event; |
| import org.apache.flex.utils.Timer; |
| |
| private var timer:org.apache.flex.utils.Timer; |
| |
| public function get symbol():String |
| { |
| return list.selectedItem as String; |
| } |
| |
| public function get city():String |
| { |
| return cityList.selectedItem as String; |
| } |
| |
| public function get inputText():String |
| { |
| return input.text; |
| } |
| |
| public function get comboBoxValue():String |
| { |
| return String(comboBox.selectedItem); |
| } |
| |
| public function startTimer():void |
| { |
| timer = new org.apache.flex.utils.Timer(1000); |
| timer.addEventListener('timer', timerHandler); |
| timer.start() |
| } |
| |
| public function timerHandler(event:org.apache.flex.events.Event):void |
| { |
| timerLabel.text = timer.currentCount.toString(); |
| } |
| ]]> |
| </fx:Script> |
| <basic:Label id="lbl" x="100" y="25" > |
| <basic:beads> |
| <basic:SimpleBinding eventName="labelTextChanged" |
| sourceID="applicationModel" |
| sourcePropertyName="labelText" |
| destinationPropertyName="text" /> |
| </basic:beads> |
| </basic:Label> |
| <basic:TextButton text="Let's Start Timer" x="100" y="75" click="startTimer()" /> |
| <basic:TextButton text="Stop Timer" x="100" y="100" click="timer.removeEventListener('timer', timerHandler);timer.stop()" /> |
| <basic:Label id="timerLabel" x="100" y="125" /> |
| |
| <basic:List id="cityList" x="200" y="75" width="100" height="75" change="dispatchEvent(new CustomEvent('cityListChanged'))"> |
| <basic:beads> |
| <basic:ConstantBinding |
| sourceID="applicationModel" |
| sourcePropertyName="cities" |
| destinationPropertyName="dataProvider" /> |
| </basic:beads> |
| </basic:List> |
| |
| <basic:TextArea x="320" y="25" width="150" height="75"> |
| <basic:beads> |
| <basic:SimpleBinding eventName="labelTextChanged" |
| sourceID="applicationModel" |
| sourcePropertyName="labelText" |
| destinationPropertyName="text" /> |
| </basic:beads> |
| </basic:TextArea> |
| <basic:TextInput id="input" x="320" y="110" /> |
| <basic:TextButton text="Transfer" x="320" y="138" click="dispatchEvent(new CustomEvent('transferClicked'))" /> |
| |
| <basic:CheckBox id="checkbox" x="320" y="170" text="Check Me" /> |
| |
| <basic:RadioButton groupName="group1" text="Apples" value="0" x="100" y="150" /> |
| <basic:RadioButton groupName="group1" text="Oranges" value="1" x="100" y="170" selected="true" /> |
| <basic:RadioButton groupName="group1" text="Grapes" value="2" x="100" y="190" /> |
| |
| <basic:RadioButton groupName="group2" text="Red" value="red" x="100" y="250" selected="true" /> |
| <basic:RadioButton groupName="group2" text="Green" value="green" x="100" y="270" /> |
| <basic:RadioButton groupName="group2" text="Blue" value="blue" x="100" y="290" /> |
| |
| <basic:DropDownList id="list" x="200" y="200" width="100" height="24" change="dispatchEvent(new CustomEvent('listChanged'))"> |
| <basic:beads> |
| <basic:ConstantBinding |
| sourceID="applicationModel" |
| sourcePropertyName="strings" |
| destinationPropertyName="dataProvider" /> |
| </basic:beads> |
| </basic:DropDownList> |
| <basic:TextButton text="OK" x="200" y="230" click="dispatchEvent(new CustomEvent('buttonClicked'))" /> |
| |
| <basic:ComboBox id="comboBox" x="320" y="200" width="100" change="dispatchEvent(new CustomEvent('comboBoxChanged'))"> |
| <basic:beads> |
| <basic:ConstantBinding |
| sourceID="applicationModel" |
| sourcePropertyName="cities" |
| destinationPropertyName="dataProvider" /> |
| </basic:beads> |
| </basic:ComboBox> |
| |
| </basic:View> |