| <?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" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| width="400"> |
| |
| <fx:Script> |
| <![CDATA[ |
| |
| [Bindable] public var nsOneCount:Number = 0; |
| [Bindable] public var nsTwoCount:Number = 0; |
| [Bindable] public var btnOneCount:Number = 0; |
| [Bindable] public var btnTwoCount:Number = 0; |
| |
| public function nsModOne():void{ |
| nsOneCount++; |
| } |
| |
| public function nsModTwo():void{ |
| nsTwoCount++; |
| } |
| |
| public function btnModOne():void{ |
| btnOneCount++; |
| } |
| |
| public function btnModTwo():void{ |
| btnTwoCount++; |
| } |
| ]]> |
| </fx:Script> |
| |
| <mx:states> |
| <mx:State name="One"/> |
| <mx:State name="Two"/> |
| </mx:states> |
| |
| <mx:NumericStepper id="ns" change.Two="nsModTwo()" change.One="nsModOne()"/> |
| <mx:Button id="btn" click="currentState='Two'" click.One="btnModOne()" click.Two="btnModTwo()"/> |
| |
| <mx:HBox> |
| <mx:Label id="ns1count" text="{nsOneCount}"/> |
| <mx:Label id="ns2count" text="{nsTwoCount}"/> |
| </mx:HBox> |
| |
| <mx:HBox> |
| <mx:Label id="btn1count" text="{btnOneCount}"/> |
| <mx:Label id="btn2count" text="{btnTwoCount}"/> |
| </mx:HBox> |
| |
| <mx:Button label.One="Go to Two" label.Two="Go to One" click.One="currentState='Two'" click.Two="currentState='One'"/> |
| |
| |
| </mx:Application> |