Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17F1218416 for ; Thu, 24 Mar 2016 19:59:29 +0000 (UTC) Received: (qmail 27714 invoked by uid 500); 24 Mar 2016 19:59:23 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 27638 invoked by uid 500); 24 Mar 2016 19:59:23 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 27120 invoked by uid 99); 24 Mar 2016 19:59:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Mar 2016 19:59:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1C112DFC75; Thu, 24 Mar 2016 19:59:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Thu, 24 Mar 2016 19:59:47 -0000 Message-Id: In-Reply-To: <843a18ed0a74461d8818b230392bb271@git.apache.org> References: <843a18ed0a74461d8818b230392bb271@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/37] git commit: [flex-asjs] [refs/heads/spark] - Added StorageExample to FlexJS examples. Added StorageExample to FlexJS examples. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1c69a390 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1c69a390 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1c69a390 Branch: refs/heads/spark Commit: 1c69a390af29678d4797d3e9648b06b69ed87510 Parents: 1bc555d Author: Peter Ent Authored: Wed Mar 9 11:13:26 2016 -0500 Committer: Peter Ent Committed: Wed Mar 9 11:13:26 2016 -0500 ---------------------------------------------------------------------- examples/build.xml | 2 + examples/flexjs/StorageExample/README.txt | 81 ++++++ .../StorageExample/StorageExample-app.xml | 252 +++++++++++++++++++ examples/flexjs/StorageExample/build.xml | 77 ++++++ examples/flexjs/StorageExample/pom.xml | 50 ++++ .../StorageExample/src/MyInitialView.mxml | 131 ++++++++++ .../StorageExample/src/StorageExample.mxml | 42 ++++ .../flexjs/StorageExample/src/models/MyModel.as | 58 +++++ 8 files changed, 693 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/build.xml ---------------------------------------------------------------------- diff --git a/examples/build.xml b/examples/build.xml index 7efccfc..27d1816 100644 --- a/examples/build.xml +++ b/examples/build.xml @@ -85,6 +85,7 @@ + @@ -113,6 +114,7 @@ + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/README.txt ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/README.txt b/examples/flexjs/StorageExample/README.txt new file mode 100644 index 0000000..12cb609 --- /dev/null +++ b/examples/flexjs/StorageExample/README.txt @@ -0,0 +1,81 @@ +Storage Example + +The StorageExample is designed to show you have to read and write simple, but permanent files using +the FlexJS Storage framework. + +Permanent storage is available when the target platform is either Adobe AIR (desktop or mobile device) +or Apache Cordova (mobile devices). + +Build the Example + +1. Run the build (ant) + +This will build both the AIR and Cordova-compatible versions. The AIR version will be in the +bin-debug directory. The Cordova-compatible versions will be in the js-debug and js-release +directories. + +Running on Adobe AIR + +1. Run the example (ant run). + +This will launch the SWF as an AIR application. + +Running on an Android Device using Cordova + +This is a somewhat complex process. The JavaScript and HTML files that were built (bin/js-debug) +need to be moved into a Cordova project. Once there, the application can be deployed to a device +or run in an emulator. + +1. In a clean directory, outside of the flex-asjs directories, use the cordova command line +interface to build an empty application: + +cordova create filetest org.apache.flex "FileTest" +cd filetest + +2. Add in the Android platform and the Cordova File plugin: + +cordova platform add android +cordova plugin add cordova-plugin-file + +3. Go to the StorageExample/bin/js-debug directory and copy all of the files and directories +into the filetest/www directory: + +index.html (replaces the index.html from the generated cordova app) +MyInitialView.js +StorageExample.css +StorageExample.js +externs/ +library/ +models/ +org/ + + +4. Open filetest/www/index.html and replace the element with this: + + + + + + + +5. Build the Cordova app from the top filetest directory: + +cordova build + +6. You can run it either in an emulator on a connected device: + +(emulator): cordova emulate android +(device): cordova run android + +The filetest/platforms/android directory can be opened from Android Studio if you want to +use an Android IDE. If you need to make changes, do that in the filetest/www directory, +then run "cordova build" again. Android Studio will detect the change, ask you to re-sync, +and after that, you can re-redeploy the changed app to the device. + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/StorageExample-app.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/StorageExample-app.xml b/examples/flexjs/StorageExample/StorageExample-app.xml new file mode 100644 index 0000000..62657d2 --- /dev/null +++ b/examples/flexjs/StorageExample/StorageExample-app.xml @@ -0,0 +1,252 @@ + + + + + + + + org.apache.flexjs.storageexample + + + Apache FlexJS Storage Example + + + Apache FlexJS Storage Example + + + 0.6.0 + + + + + + + + + Copyright 2015 The Apache Software Foundation. + + + + + + + + + StorageExample.swf + + + + + + + + + + + + + + + + + + + + + + + + 640 + + + 720 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + true + + + + + + + + + extendedDesktop desktop + + + Apache Flex + + + Apache Flex + + + + assets/icons/16.png + assets/icons/29.png + assets/icons/32.png + assets/icons/36.png + assets/icons/48.png + assets/icons/57.png + assets/icons/72.png + assets/icons/114.png + assets/icons/128.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/build.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/build.xml b/examples/flexjs/StorageExample/build.xml new file mode 100644 index 0000000..a976cad --- /dev/null +++ b/examples/flexjs/StorageExample/build.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + playerglobal.version = ${playerglobal.version} + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/pom.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/pom.xml b/examples/flexjs/StorageExample/pom.xml new file mode 100644 index 0000000..06ac9b2 --- /dev/null +++ b/examples/flexjs/StorageExample/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + + org.apache.flex.examples.flexjs + examples + 1.0.0-SNAPSHOT + + + StorageExample + 1.0.0-SNAPSHOT + swf + + + src + + + net.flexmojos.oss + flexmojos-maven-plugin + 7.1.0-SNAPSHOT + true + + StorageExample.mxml + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/src/MyInitialView.mxml b/examples/flexjs/StorageExample/src/MyInitialView.mxml new file mode 100644 index 0000000..2bb6b7a --- /dev/null +++ b/examples/flexjs/StorageExample/src/MyInitialView.mxml @@ -0,0 +1,131 @@ + + + + + + + + + + .labelStyle { + color: #9999FF; + } + + .contentStyle { + font-size: 18pt; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/src/StorageExample.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/src/StorageExample.mxml b/examples/flexjs/StorageExample/src/StorageExample.mxml new file mode 100644 index 0000000..1b9842a --- /dev/null +++ b/examples/flexjs/StorageExample/src/StorageExample.mxml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1c69a390/examples/flexjs/StorageExample/src/models/MyModel.as ---------------------------------------------------------------------- diff --git a/examples/flexjs/StorageExample/src/models/MyModel.as b/examples/flexjs/StorageExample/src/models/MyModel.as new file mode 100644 index 0000000..e0dab68 --- /dev/null +++ b/examples/flexjs/StorageExample/src/models/MyModel.as @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +package models +{ + import org.apache.flex.core.IBeadModel; + import org.apache.flex.core.IStrand; + import org.apache.flex.events.Event; + import org.apache.flex.events.EventDispatcher; + + public class MyModel extends EventDispatcher implements IBeadModel + { + public function MyModel() + { + super(); + } + + private var _strand:IStrand; + + public function set strand(value:IStrand):void + { + _strand = value; + } + + private var _cities:Array = ["Sydney", "NYC", "Mexico City", "London", "Rio de Janeiro"]; + + [Bindable] + public function get cities():Array + { + return _cities; + } + + private var _coordinates:Array = [{lat:-33.86, lng:151.211}, + {lat:40.712, lng:-74.0059}, + {lat:19.26, lng:-99.03}, + {lat:51.4, lng:-0.1}, + {lat:-22.95, lng:-43.12}]; + public function get coordinates():Array + { + return _coordinates; + } + } +} \ No newline at end of file