Added BubbleTest
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/33df5298 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/33df5298 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/33df5298 Branch: refs/heads/feature/amf Commit: 33df529896eba68bd9ee11ab0dad2296544db8af Parents: d0ac21c Author: Harbs <ha...@in-tools.com> Authored: Mon Jul 24 00:53:12 2017 +0300 Committer: Harbs <ha...@in-tools.com> Committed: Mon Jul 24 00:53:12 2017 +0300 ---------------------------------------------------------------------- manualtests/BubbleTest/build.xml | 73 +++++++++++++ manualtests/BubbleTest/src/BubbleTest.mxml | 135 ++++++++++++++++++++++++ 2 files changed, 208 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33df5298/manualtests/BubbleTest/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/BubbleTest/build.xml b/manualtests/BubbleTest/build.xml new file mode 100644 index 0000000..6cea9d2 --- /dev/null +++ b/manualtests/BubbleTest/build.xml @@ -0,0 +1,73 @@ +<?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. + +--> + + +<project name="bubbletest" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="BubbleTest" /> + <property name="swf.version" value="11" /> + + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <!-- use this to add keep metadata option --> + <property name="theme_arg" value="-keep-as3-metadata+=Event" /> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of FlexJSUI.swc"> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33df5298/manualtests/BubbleTest/src/BubbleTest.mxml ---------------------------------------------------------------------- diff --git a/manualtests/BubbleTest/src/BubbleTest.mxml b/manualtests/BubbleTest/src/BubbleTest.mxml new file mode 100644 index 0000000..6d90ad8 --- /dev/null +++ b/manualtests/BubbleTest/src/BubbleTest.mxml @@ -0,0 +1,135 @@ +<?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/flexjs/basic" + > + <fx:Script> + <![CDATA[ + import org.apache.flex.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>