You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2019/07/15 08:18:05 UTC
[royale-asjs] branch develop updated: Added FileProxy example,
swf version still not working. Fixes #433.
This is an automated email from the ASF dual-hosted git repository.
yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 2672ff3 Added FileProxy example, swf version still not working. Fixes #433.
2672ff3 is described below
commit 2672ff376a2df61f94e477238d411aa3f471d660
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Jul 15 11:16:00 2019 +0300
Added FileProxy example, swf version still not working. Fixes #433.
---
examples/royale/FileProxy/FileProxy.as3proj | 89 ++++++++++++++++++++++
examples/royale/FileProxy/asconfig.json | 31 ++++++++
examples/royale/FileProxy/build.xml | 54 +++++++++++++
examples/royale/FileProxy/pom.xml | 87 +++++++++++++++++++++
.../FileProxy/src/main/royale/FileProxy.mxml | 69 +++++++++++++++++
5 files changed, 330 insertions(+)
diff --git a/examples/royale/FileProxy/FileProxy.as3proj b/examples/royale/FileProxy/FileProxy.as3proj
new file mode 100644
index 0000000..de13037
--- /dev/null
+++ b/examples/royale/FileProxy/FileProxy.as3proj
@@ -0,0 +1,89 @@
+<?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.
+
+-->
+<project>
+ <output>
+ <movie version="11"/>
+ <movie disabled="False"/>
+ <movie height="600"/>
+ <movie fps="60"/>
+ <movie background="#FFFFFF"/>
+ <movie path="bin-debug/FileProxy.swf"/>
+ <movie width="800"/>
+ <movie input=""/>
+ </output>
+ <!-- Other classes to be compiled into your SWF -->
+ <classpaths>
+ <class path="src/main/royale"/>
+ </classpaths>
+ <moonshineResourcePaths></moonshineResourcePaths>
+ <build>
+ <option customSDK=""/>
+ <option strict="True"/>
+ <option accessible="False"/>
+ <option useNetwork="True"/>
+ <option allowSourcePathOverlap="False"/>
+ <option useResourceBundleMetadata="True"/>
+ <option benchmark="False"/>
+ <option warnings="True"/>
+ <option additional=""/>
+ <option es="False"/>
+ <option locale=""/>
+ <option loadConfig=""/>
+ <option linkReport=""/>
+ <option optimize="False"/>
+ <option verboseStackTraces="False"/>
+ <option staticLinkRSL="False"/>
+ <option showBindingWarnings="True"/>
+ <option compilerConstants=""/>
+ <option showDeprecationWarnings="True"/>
+ <option antBuildPath="build/build.xml"/>
+ <option showActionScriptWarnings="True"/>
+ <option showUnusedTypeSelectorWarnings="True"/>
+ </build>
+ <includeLibraries></includeLibraries>
+ <libraryPaths></libraryPaths>
+ <externalLibraryPaths></externalLibraryPaths>
+ <rslPaths></rslPaths>
+ <intrinsics></intrinsics>
+ <library></library>
+ <compileTargets>
+ <compile path="src/main/royale/FileProxy.mxml"/>
+ </compileTargets>
+ <hiddenPaths></hiddenPaths>
+ <preBuildCommand>null</preBuildCommand>
+ <postBuildCommand alwaysRun="False">null</postBuildCommand>
+ <options>
+ <option defaultBuildTargets=""/>
+ <option testMovie=""/>
+ <option testMovieCommand=""/>
+ <option showHiddenPaths="False"/>
+ </options>
+ <moonshineRunCustomization>
+ <option deviceSimulator="null"/>
+ <option targetPlatform="2"/>
+ <option projectType="2"/>
+ <option launchMethod="Simulator"/>
+ <option urlToLaunch=""/>
+ <deviceSimulator>null</deviceSimulator>
+ <certAndroid>null</certAndroid>
+ <certIos>null</certIos>
+ <certIosProvisioning>null</certIosProvisioning>
+ </moonshineRunCustomization>
+</project>
diff --git a/examples/royale/FileProxy/asconfig.json b/examples/royale/FileProxy/asconfig.json
new file mode 100644
index 0000000..e0ac411
--- /dev/null
+++ b/examples/royale/FileProxy/asconfig.json
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+{
+ "config": "royale",
+ "compilerOptions": {
+ "debug": false,
+ "targets": ["JSRoyale","SWF"],
+ "source-map": true
+ },
+ "additionalOptions": "-remove-circulars -js-output-optimization=skipAsCoercions",
+ "files":
+ [
+ "src/main/royale/FileProxy.mxml"
+ ]
+}
diff --git a/examples/royale/FileProxy/build.xml b/examples/royale/FileProxy/build.xml
new file mode 100644
index 0000000..593beae
--- /dev/null
+++ b/examples/royale/FileProxy/build.xml
@@ -0,0 +1,54 @@
+<?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="fileproxy" default="main" basedir=".">
+ <property name="ROYALE_HOME" location="../../.."/>
+ <property name="example" value="FileProxy" />
+
+ <property file="${ROYALE_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${ROYALE_HOME}/build.properties"/>
+ <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+
+ <include file="${basedir}/../../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compile" description="Clean build of ${example}">
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ <delete dir="${basedir}/target" failonerror="false" />
+ </target>
+
+ <target name="examine" depends="build_example.get.browser">
+ <property name="which" value="debug" />
+ <echo message="Make sure label appears."/>
+ <exec executable="${browser}" dir="${basedir}/bin-${which}" failonerror="true">
+ <arg value="${basedir}/bin-${which}/${example}.html"/>
+ </exec>
+ <exec executable="${browser}" dir="${basedir}/bin/js-${which}" failonerror="true">
+ <arg value="${basedir}/bin/js-${which}/index.html"/>
+ </exec>
+ </target>
+
+</project>
diff --git a/examples/royale/FileProxy/pom.xml b/examples/royale/FileProxy/pom.xml
new file mode 100644
index 0000000..0b35e9c
--- /dev/null
+++ b/examples/royale/FileProxy/pom.xml
@@ -0,0 +1,87 @@
+<?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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.royale.examples</groupId>
+ <artifactId>examples-royale</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>FileProxy</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <packaging>swf</packaging>
+
+ <name>Apache Royale: Examples: Royale: FileProxy</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.royale.compiler</groupId>
+ <artifactId>royale-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <targets>SWF,JSRoyale</targets>
+ <debug>false</debug>
+ <removeCirculars>true</removeCirculars>
+ <mainClass>FileProxy.mxml</mainClass>
+ <additionalCompilerOptions>
+ -js-complex-implicit-coercions=false;
+ -js-vector-index-checks=false;
+ -js-resolve-uncertain=false;
+ </additionalCompilerOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.adobe.flash.framework</groupId>
+ <artifactId>playerglobal</artifactId>
+ <version>${flash.version}</version>
+ <type>swc</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Basic</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Basic</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>BasicTheme</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <scope>theme</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/examples/royale/FileProxy/src/main/royale/FileProxy.mxml b/examples/royale/FileProxy/src/main/royale/FileProxy.mxml
new file mode 100644
index 0000000..11b30c6
--- /dev/null
+++ b/examples/royale/FileProxy/src/main/royale/FileProxy.mxml
@@ -0,0 +1,69 @@
+<?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:js="library://ns.apache.org/royale/basic" >
+
+ <fx:Declarations>
+ <js:FileProxy id="myFileProxy" modelChanged="modelChangedHandler(event)">
+ <js:beads>
+ <js:FileBrowser id="myBrowser"/>
+ <js:FileLoader id="myLoader"/>
+ </js:beads>
+ </js:FileProxy>
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.MouseEvent;
+ import org.apache.royale.file.beads.FileModel;
+ import org.apache.royale.html.SimpleAlert;
+
+ protected function clickHandler(event:org.apache.royale.events.MouseEvent):void
+ {
+ myBrowser.browse();
+ }
+
+ protected function modelChangedHandler(event:org.apache.royale.events.Event):void
+ {
+ myFileProxy.model.addEventListener("blobChanged", blobChangedHandler);
+ trace('loading: ' + myFileProxy.name);
+ myLoader.load();
+ }
+
+ private function blobChangedHandler(e:org.apache.royale.events.Event):void
+ {
+ var fileModel:FileModel = myFileProxy.model as FileModel;
+ SimpleAlert.show(fileModel.blob.length + " bytes of " + fileModel.name + " were loaded", this);
+ }
+
+ ]]>
+ </fx:Script>
+
+
+ <js:valuesImpl>
+ <js:SimpleCSSValuesImpl />
+ </js:valuesImpl>
+
+ <js:initialView>
+ <js:View>
+ <js:TextButton text="Browse" click="clickHandler(event)"/>
+ </js:View>
+ </js:initialView>
+</js:Application>