| <?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. |
| |
| --> |
| <createjs:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:js="library://ns.apache.org/royale/basic" |
| xmlns:createjs="library://ns.apache.org/royale/createjs" |
| > |
| <fx:Script> |
| <![CDATA[ |
| |
| import org.apache.royale.events.Event; |
| |
| public function simpleClick() : void |
| { |
| lbl1.text = "pushed"; |
| } |
| |
| public function changeLabel() : void |
| { |
| dispatchEvent( new org.apache.royale.events.Event("pushme2Clicked") ); |
| |
| check1.selected = !check1.selected; |
| } |
| ]]> |
| </fx:Script> |
| |
| <createjs:Label id="lbl1" x="50" y="100" text="push me changes me" /> |
| <createjs:TextButton x="50" y="225" text="Push Me" click="simpleClick()" /> |
| |
| <createjs:Label id="lbl2" x="350" y="100"> |
| <createjs:beads> |
| <js:SimpleBinding eventName="labelTextChanged" |
| sourceID="applicationModel" |
| sourcePropertyName="labelText" |
| destinationPropertyName="text" /> |
| </createjs:beads> |
| </createjs:Label> |
| <createjs:TextButton x="350" y="225" text="Change Label" click="changeLabel()"/> |
| |
| <createjs:CheckBox id="check1" x="10" y="10" text="Check Me" selected="true"/> |
| |
| </createjs:View> |