| <?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. |
| // |
| //////////////////////////////////////////////////////////////////////////////// |
| --> |
| <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:local="*" |
| xmlns:models="models.*" |
| xmlns:controllers="controllers.*" |
| xmlns:js="library://ns.apache.org/royale/basic" |
| > |
| <fx:Script> |
| <![CDATA[ |
| import org.apache.royale.events.Event; |
| private function init():void |
| { |
| outer.addEventListener(MouseEvent.MOUSE_DOWN,outerHandler); |
| outer.addEventListener(MouseEvent.MOUSE_DOWN,outer2Handler); |
| outer.addEventListener(MouseEvent.MOUSE_DOWN,outer3Handler); |
| inner.addEventListener(MouseEvent.MOUSE_DOWN,innerHandler); |
| inner.addEventListener(MouseEvent.MOUSE_DOWN,inner2Handler); |
| inner.addEventListener(MouseEvent.MOUSE_DOWN,inner3Handler); |
| btnfoo.addEventListener(MouseEvent.MOUSE_DOWN,buttonHandler); |
| btnfoo.addEventListener(MouseEvent.MOUSE_DOWN,button2Handler); |
| btnfoo.addEventListener(MouseEvent.MOUSE_DOWN,button3Handler); |
| btnbar.addEventListener(MouseEvent.MOUSE_DOWN,btnbarHandler); |
| btnbar.addEventListener(MouseEvent.MOUSE_DOWN,btnbar2Handler); |
| btnbar.addEventListener(MouseEvent.MOUSE_DOWN,btnbar3Handler); |
| btnbaz.addEventListener(MouseEvent.MOUSE_DOWN,btnbazHandler); |
| btnbaz.addEventListener(MouseEvent.MOUSE_DOWN,btnbaz2Handler); |
| btnbaz.addEventListener(MouseEvent.MOUSE_DOWN,btnbaz3Handler); |
| } |
| private function innerHandler(ev:Event):void |
| { |
| trace("inner: " + ev.type); |
| } |
| private function inner2Handler(ev:Event):void |
| { |
| trace("inner2: " + ev.type); |
| } |
| private function inner3Handler(ev:Event):void |
| { |
| trace("inner3: " + ev.type); |
| } |
| private function outerHandler(ev:Event):void |
| { |
| trace("outer: " + ev.type); |
| } |
| private function outer2Handler(ev:Event):void |
| { |
| trace("outer2: " + ev.type); |
| } |
| private function outer3Handler(ev:Event):void |
| { |
| trace("outer3: " + ev.type); |
| } |
| private function buttonHandler(ev:Event):void |
| { |
| trace("button: " + ev.type); |
| } |
| private function button2Handler(ev:Event):void |
| { |
| trace("button2: " + ev.type); |
| } |
| private function button3Handler(ev:Event):void |
| { |
| trace("button3: " + ev.type); |
| } |
| private function btnbarHandler(ev:Event):void |
| { |
| trace("btnbar: " + ev.type); |
| ev.stopPropagation(); |
| } |
| private function btnbar2Handler(ev:Event):void |
| { |
| trace("btnbar2: " + ev.type); |
| } |
| private function btnbar3Handler(ev:Event):void |
| { |
| trace("btnbar3: " + ev.type); |
| } |
| private function btnbazHandler(ev:Event):void |
| { |
| trace("btnbaz: " + ev.type); |
| ev.stopImmediatePropagation(); |
| } |
| private function btnbaz2Handler(ev:Event):void |
| { |
| trace("btnbaz2: " + ev.type); |
| } |
| private function btnbaz3Handler(ev:Event):void |
| { |
| trace("btnbaz3: " + ev.type); |
| } |
| ]]> |
| </fx:Script> |
| <fx:Style> |
| |
| </fx:Style> |
| <js:beads> |
| <js:ApplicationDataBinding /> |
| </js:beads> |
| <js:valuesImpl> |
| <js:SimpleCSSValuesImpl /> |
| </js:valuesImpl> |
| <js:initialView> |
| <js:View width="100%" height="100%" initComplete="init()"> |
| <js:Container id="outer" style="background-color:orange" width="400" height="400"> |
| <js:Container id="inner" style="background-color:yellow" width="300" height="300"> |
| <js:Label id="foo" text="foo" x="10" y="10"/> |
| <js:Label id="bar" text="bar" x="10" y="100"/> |
| <js:Label id="baz" text="bar" x="10" y="190"/> |
| <js:TextButton id="btnfoo" x="100" y="10" text="Bubbles"/> |
| <js:TextButton id="btnbar" x="100" y="100" text="stopPropogation"/> |
| <js:TextButton id="btnbaz" x="100" y="190" text="stopImmediatePropogation"/> |
| </js:Container> |
| </js:Container> |
| </js:View> |
| </js:initialView> |
| </js:Application> |