StorageExample uses cordova:Application so it runs on both Cordova and Air 
platforms.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/01d8523f
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/01d8523f
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/01d8523f

Branch: refs/heads/tlf
Commit: 01d8523fe3c38830531a2fb33f2a320d9f143bea
Parents: f72cf76
Author: Peter Ent <[email protected]>
Authored: Fri Jun 2 11:44:24 2017 -0400
Committer: Peter Ent <[email protected]>
Committed: Fri Jun 2 11:44:24 2017 -0400

----------------------------------------------------------------------
 .../src/main/flex/MyInitialView.mxml             |  8 +++++++-
 .../src/main/flex/StorageExample.mxml            | 19 ++++++++++---------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01d8523f/examples/flexjs/StorageExample/src/main/flex/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/StorageExample/src/main/flex/MyInitialView.mxml 
b/examples/flexjs/StorageExample/src/main/flex/MyInitialView.mxml
index 31d14a8..a3ac9c4 100644
--- a/examples/flexjs/StorageExample/src/main/flex/MyInitialView.mxml
+++ b/examples/flexjs/StorageExample/src/main/flex/MyInitialView.mxml
@@ -34,6 +34,11 @@ limitations under the License.
                                trace("Starting up");
                        }
                        
+                       public function set ready(value:Boolean):void
+                       {
+                               status.text = "Now Ready";
+                       }
+                       
                        // READING - PLAIN
                        
                        private function onRead():void
@@ -115,6 +120,7 @@ limitations under the License.
                                var useContent:String = today.toString() + " " 
+ contentField.text;
                                
                                storage.addEventListener("WRITE", handleSave);
+                               storage.addEventListener("ERROR", 
handleSaveError);
                                storage.writeTextToDataFile(useFile, 
useContent);
                        }
                        
@@ -221,7 +227,7 @@ limitations under the License.
                </js:HGroup>
                <js:Spacer height="20" />
                
-               <js:Label id="status" />
+               <js:Label id="status" text="** APP STATUS HERE **" />
                <js:Spacer height="20" />
                
                <js:HGroup>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01d8523f/examples/flexjs/StorageExample/src/main/flex/StorageExample.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/StorageExample/src/main/flex/StorageExample.mxml 
b/examples/flexjs/StorageExample/src/main/flex/StorageExample.mxml
index 17b81fa..eec2160 100644
--- a/examples/flexjs/StorageExample/src/main/flex/StorageExample.mxml
+++ b/examples/flexjs/StorageExample/src/main/flex/StorageExample.mxml
@@ -18,10 +18,11 @@
 //
 
////////////////////////////////////////////////////////////////////////////////
 -->
-<js:AirApplication xmlns:fx="http://ns.adobe.com/mxml/2009";
+<cordova:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                                   xmlns:local="*"
+                                  
xmlns:cordova="library://ns.apache.org/flexjs/cordova"
                                   
xmlns:js="library://ns.apache.org/flexjs/basic" 
-                                  >
+                                  
applicationComplete="MyInitialView(initialView).ready = true">
        
        <!-- This application demonstrates how to use the Google MAP API
             on both the AIR and JavaScript/browser platform. After cross-
@@ -29,14 +30,14 @@
             file and include your Google developer API token.
        -->
        
-       <js:valuesImpl>
+       <cordova:valuesImpl>
                <js:SimpleCSSValuesImpl />
-       </js:valuesImpl>
-       <js:initialView>
+       </cordova:valuesImpl>
+       <cordova:initialView>
                <local:MyInitialView />
-       </js:initialView>
-       <js:beads>
+       </cordova:initialView>
+       <cordova:beads>
                <js:MixinManager />
-       </js:beads>
+       </cordova:beads>
        
-</js:AirApplication>
+</cordova:Application>

Reply via email to