You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/11/04 20:16:00 UTC

[10/22] git commit: [flex-examples] [refs/heads/develop] - updates

updates

Signed-off-by: OmPrakash Muppirala <bi...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/flex-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-examples/commit/015a6901
Tree: http://git-wip-us.apache.org/repos/asf/flex-examples/tree/015a6901
Diff: http://git-wip-us.apache.org/repos/asf/flex-examples/diff/015a6901

Branch: refs/heads/develop
Commit: 015a6901c16d5d004a0cafb900316acc8ba64279
Parents: 0bfb28e
Author: nasha001 <na...@DM-DT-NASH.hartford.gov>
Authored: Tue Nov 4 12:50:29 2014 -0500
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Tue Nov 4 11:07:37 2014 -0800

----------------------------------------------------------------------
 .../src/AIRViews/AccelerometerView.mxml         |  36 ++-
 tourdeflexmobile/src/AIRViews/CameraView.mxml   | 106 +++++++
 .../src/AIRViews/GeolocationView.mxml           | 118 ++++++++
 tourdeflexmobile/src/AIRViews/SQLiteView.mxml   |  49 +--
 tourdeflexmobile/src/TourDeFlexMobile-app.xml   |  59 ++--
 tourdeflexmobile/src/TourDeFlexMobile.mxml      | 300 +++++++++----------
 6 files changed, 448 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/AIRViews/AccelerometerView.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/AIRViews/AccelerometerView.mxml b/tourdeflexmobile/src/AIRViews/AccelerometerView.mxml
index 50b8553..06c528e 100644
--- a/tourdeflexmobile/src/AIRViews/AccelerometerView.mxml
+++ b/tourdeflexmobile/src/AIRViews/AccelerometerView.mxml
@@ -18,7 +18,10 @@ limitations under the License.
 
 -->
 <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
-		xmlns:s="library://ns.adobe.com/flex/spark" title="Accelerometer" viewActivate="init()" viewDeactivate="deactivate(event)">
+		xmlns:s="library://ns.adobe.com/flex/spark" 
+		title="Accelerometer" 
+		viewActivate="init()" 
+		viewDeactivate="deactivate(event)">
 	
 	<fx:Script>
 		<![CDATA[
@@ -28,7 +31,6 @@ limitations under the License.
 			import flash.sensors.Accelerometer;
 			
 			import spark.events.ViewNavigatorEvent;
-			import spark.skins.mobile.TextAreaSkin;		
 			
 			private var ball:Sprite;
 			private var accelerometer:Accelerometer;        
@@ -77,13 +79,13 @@ limitations under the License.
 					ball.x = RADIUS;
 					xSpeed = 0;
 				}
-				
-				else if (newX > stage.stageWidth - RADIUS)
+					
+				else if (newX > this.width - RADIUS)
 				{
-					ball.x = stage.stageWidth - RADIUS;
+					ball.x = this.width - RADIUS;
 					xSpeed = 0;
 				}
-				
+					
 				else
 				{
 					ball.x += xSpeed;
@@ -94,13 +96,13 @@ limitations under the License.
 					ball.y = RADIUS;
 					ySpeed = 0;
 				}
-				
+					
 				else if (newY > this.height - RADIUS)
 				{
 					ball.y = this.height - RADIUS;
 					ySpeed = 0;
 				}
-				
+					
 				else
 				{
 					ball.y += ySpeed;
@@ -120,9 +122,12 @@ limitations under the License.
 			
 			protected function buttonHandler(event:MouseEvent):void
 			{
-				if(currentState == "DemoState"){
+				if(currentState == "DemoState")
+				{
 					currentState = "InfoState";				
-				}else if(currentState == "InfoState"){
+				}
+				else if(currentState == "InfoState")
+				{
 					currentState = "DemoState";
 				}
 			}
@@ -134,15 +139,14 @@ limitations under the License.
 		<s:State name="DemoState"/>
 		<s:State name="InfoState"/>
 	</s:states>
-	
 	<fx:Declarations>
-		<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" source320dpi="@Embed('assets/icons/320/about.png')"/>
-		<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" source320dpi="@Embed('assets/icons/320/dock.png')"/>
+		<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" 
+								source320dpi="@Embed('assets/icons/320/about.png')" source480dpi="assets/icons/480/about.png"/>
+		<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" 
+								source320dpi="@Embed('assets/icons/320/dock.png')" source480dpi="assets/icons/480/dock.png"/>
 	</fx:Declarations>
-
 	<s:SpriteVisualElement id="container" includeIn="DemoState"/>
-	
-	<s:TextArea includeIn="InfoState" skinClass="spark.skins.mobile.TextAreaSkin" left="10" right="10" top="10" bottom="10" editable="false" text="The Accelerometer class dispatches events based on activity detected by the device's motion sensor. This data represents the device's location or movement along a 3-dimensional axis. When the device moves, the sensor detects this movement and returns acceleration data. The Accelerometer class provides methods to query whether or not accelerometer is supported, and also to set the rate at which acceleration events are dispatched.
+	<s:TextArea includeIn="InfoState" selectable="false" left="10" right="10" top="10" bottom="10" editable="false" text="The Accelerometer class dispatches events based on activity detected by the device's motion sensor. This data represents the device's location or movement along a 3-dimensional axis. When the device moves, the sensor detects this movement and returns acceleration data. The Accelerometer class provides methods to query whether or not accelerometer is supported, and also to set the rate at which acceleration events are dispatched.
 				&#xd; &#xd;Note: Use the Accelerometer.isSupported property to test the runtime environment for the ability to use this feature. While the Accelerometer class and its members are accessible to the Runtime Versions listed for each API entry, the current environment for the runtime determines the availability of this feature. For example, you can compile code using the Accelerometer class properties for Flash Player 10.1, but you need to use the Accelerometer.isSupported property to test for the availability of the Accelerometer feature in the current deployment environment for the Flash Player runtime. If Accelerometer.isSupported is true at runtime, then Accelerometer support currently exists."/>
 	
 	<s:actionContent>

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/AIRViews/CameraView.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/AIRViews/CameraView.mxml b/tourdeflexmobile/src/AIRViews/CameraView.mxml
new file mode 100644
index 0000000..a1e26f5
--- /dev/null
+++ b/tourdeflexmobile/src/AIRViews/CameraView.mxml
@@ -0,0 +1,106 @@
+<?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.
+
+-->
+<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		xmlns:s="library://ns.adobe.com/flex/spark" 
+		xmlns:mx="library://ns.adobe.com/flex/mx"
+		title="Camera" 
+		viewDeactivate="deactivate(event)" 
+		viewActivate="init(event)">
+	
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.core.UIComponent;
+			
+			import spark.events.ViewNavigatorEvent;
+			
+			private var camera:Camera;
+			
+			private function init(event:ViewNavigatorEvent):void
+			{			
+				if(Camera.isSupported)
+				{					
+					camera = Camera.getCamera();
+					camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
+					camera.setMode(640, 480, 25);
+					camera.setQuality(0, 100);
+					var video:Video = new Video(width,height) 
+					video.attachCamera(camera);
+					var videoHolder:UIComponent = new UIComponent(); 
+					videoHolder.x = 0; 
+				 	videoHolder.y = 0; 
+					videoHolder.percentWidth = 100;
+					videoHolder.percentHeight = 100;
+					videoHolder.addChild(video); 
+					videoDisplay.addElement(videoHolder);
+				}
+			}
+			
+			private function activityHandler(event:ActivityEvent):void 
+			{
+				trace("activityHandler: " + event);
+			}
+			
+			protected function buttonHandler(event:MouseEvent):void
+			{
+				if(currentState == "DemoState")
+				{
+					currentState = "InfoState";				
+				}
+				else if(currentState == "InfoState")
+				{
+					currentState = "DemoState";
+				}
+			}
+			
+			private function deactivate(event:ViewNavigatorEvent):void
+			{
+				camera.removeEventListener(ActivityEvent.ACTIVITY, activityHandler);
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<s:states>
+		<s:State name="DemoState"/>
+		<s:State name="InfoState"/>
+	</s:states>
+	
+	<fx:Declarations>
+		<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" source320dpi="@Embed('assets/icons/320/about.png')"/>
+		<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" source320dpi="@Embed('assets/icons/320/dock.png')"/>
+	</fx:Declarations>
+	<s:Group width="100%" height="100%" id="videoDisplay"/>
+	
+	<s:TextArea includeIn="InfoState" selectable="false"  left="10" right="10" top="10" bottom="10" editable="false" 
+				text="Use the Camera class to capture video from the client system or device camera. Use the Video class to monitor the video locally. Use the NetConnection and NetStream classes to transmit the video to Flash Media Server. Flash Media Server can send the video stream to other servers and broadcast it to other clients running Flash Player or AIR. 
+				&#xd; &#xd;A Camera instance captures video in landscape aspect ratio. On devices that can change the screen orientation, such as mobile phones, a Video object attached to the camera will only show upright video in a landscape-aspect orientation. Thus, mobile apps should use a landscape orientation when displaying video and should not auto-rotate.
+				
+				&#xd; &#xd;On iOS, the video from the front camera is mirrored. On Android, it is not.
+				
+				&#xd; &#xd;On mobile devices with an autofocus camera, autofocus is enabled automatically. If the camera does not support continuous autofocus, and many mobile device cameras do not, then the camera is focused when the Camera object is attached to a video stream and whenever the setMode() method is called. On desktop computers, autofocus behavior is dependent on the camera driver and settings.
+				
+				&#xd; &#xd;In an AIR application on Android and iOS, the camera does not capture video while an AIR app is not the active, foreground application. In addition, streaming connections can be lost when the application is in the background. On iOS, the camera video cannot be displayed when an application uses the GPU rendering mode. The camera video can still be streamed to a server."/>
+	
+	<s:actionContent>
+		<s:Button click="buttonHandler(event)" icon.DemoState="{aboutIcon}" icon.InfoState="{demoIcon}"/>
+	</s:actionContent>
+</s:View>

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/AIRViews/GeolocationView.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/AIRViews/GeolocationView.mxml b/tourdeflexmobile/src/AIRViews/GeolocationView.mxml
new file mode 100644
index 0000000..3b2ee2b
--- /dev/null
+++ b/tourdeflexmobile/src/AIRViews/GeolocationView.mxml
@@ -0,0 +1,118 @@
+<?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.
+
+-->
+<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		xmlns:s="library://ns.adobe.com/flex/spark" 
+		title="Geolocation" 
+		viewDeactivate="endGeolocation(event)" 
+		viewActivate="init(event)">
+	
+	<fx:Script>
+		<![CDATA[
+			import flash.sensors.Geolocation;			
+			import spark.events.ViewNavigatorEvent;
+			
+			private var geo:Geolocation;		
+			
+			protected function init(event:ViewNavigatorEvent):void
+			{
+				if (Geolocation.isSupported) 
+				{ 
+					geoToggle.enabled = true;
+					geo = new Geolocation(); 
+					geo.setRequestedUpdateInterval(8000);
+				}
+				else 
+				{ 
+					label.text = "Geolocation not supported"; 
+				} 
+			}
+			
+			protected function geoLocate():void
+			{
+				if(geoToggle.selected == true)
+				{
+					geo.addEventListener(GeolocationEvent.UPDATE, geoUpdateHandler); 				
+				}
+				if(geoToggle.selected == false)
+				{
+					geo.removeEventListener(GeolocationEvent.UPDATE, geoUpdateHandler); 					
+				}
+			}
+
+			
+			public function geoUpdateHandler(event:GeolocationEvent):void 
+			{ 
+				latitude.text = "latitude : " + event.latitude.toString(); 
+				longitude.text = "longitude : " + event.longitude.toString();
+				heading.text = "heading : " + event.heading.toString();
+				speed.text = "speed : " + event.speed.toString();
+			} 
+
+			protected function buttonHandler(event:MouseEvent):void
+			{
+				if(currentState == "DemoState")
+				{
+					currentState = "InfoState";				
+				}
+				else if(currentState == "InfoState")
+				{
+					currentState = "DemoState";
+				}
+			}
+			
+			protected function endGeolocation(event:ViewNavigatorEvent):void
+			{
+				if(geoToggle.selected == true)
+				{
+					geo.removeEventListener(GeolocationEvent.UPDATE, geoUpdateHandler);	
+				}						
+			}
+			
+		]]>
+	</fx:Script>
+	<s:states>
+		<s:State name="DemoState"/>
+		<s:State name="InfoState"/>
+	</s:states>	
+	<fx:Declarations>
+		<s:MultiDPIBitmapSource source160dpi="@Embed('assets/icons/160/about.png')" id="aboutIcon"  
+								source240dpi="@Embed('assets/icons/240/about.png')" 
+								source320dpi="@Embed('assets/icons/320/about.png')"
+								source480dpi="@Embed('assets/icons/480/about.png')"/>
+		<s:MultiDPIBitmapSource source160dpi="@Embed('assets/icons/160/dock.png')" id="demoIcon"
+								source240dpi="@Embed('assets/icons/240/dock.png')"  
+								source320dpi="@Embed('assets/icons/320/dock.png')"
+								source480dpi="@Embed('assets/icons/480/dock.png')"/>	
+	</fx:Declarations>
+	<s:ToggleSwitch includeIn="DemoState" horizontalCenter="0" y="20" id="geoToggle" enabled="false" change="geoLocate()"/>
+	<s:VGroup width="100%" height="100%" left="10" right="10" top="55" bottom="10" includeIn="DemoState">
+		<s:Label id="label" left="10"/>
+		<s:Label id="latitude" left="10"/>
+		<s:Label id="longitude" left="10"/>
+		<s:Label id="heading" left="10"/>
+		<s:Label id="speed" left="10"/>
+	</s:VGroup>	
+	<s:TextArea includeIn="InfoState" selectable="false"  left="10" right="10" top="10" bottom="10" editable="false" text="The Geolocation class dispatches events in response to the device's location sensor.				
+				&#xd; &#xd;If a device supports geolocation, you can use this class to obtain the current geographical location of the device. The geographical location is displayed on the device in the form of latitudinal and longitudinal coordinates (in WGS-84 standard format). When the location of the device changes, you can receive updates about the changes. If the device supports this feature, you will be able to obtain information about the altitude, accuracy, heading, speed, and timestamp of the latest change in the location.
+				&#xd; &#xd;AIR profile support: This feature is supported only on mobile devices. It is not supported on desktop or AIR for TV devices."/>	
+	<s:actionContent>
+		<s:Button click="buttonHandler(event)" icon.DemoState="{aboutIcon}" icon.InfoState="{demoIcon}"/>
+	</s:actionContent>
+</s:View>

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/AIRViews/SQLiteView.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/AIRViews/SQLiteView.mxml b/tourdeflexmobile/src/AIRViews/SQLiteView.mxml
index c2db60f..4ead4f5 100644
--- a/tourdeflexmobile/src/AIRViews/SQLiteView.mxml
+++ b/tourdeflexmobile/src/AIRViews/SQLiteView.mxml
@@ -18,7 +18,9 @@ limitations under the License.
 
 -->
 <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
-		xmlns:s="library://ns.adobe.com/flex/spark" title="SQLite" viewActivate="init(event)">
+		xmlns:s="library://ns.adobe.com/flex/spark" 
+		title="SQLite" 
+		viewActivate="init(event)">
 	
 	<fx:Script>
 		<![CDATA[
@@ -26,7 +28,6 @@ limitations under the License.
 			import mx.events.FlexEvent;
 			
 			import spark.events.ViewNavigatorEvent;
-			import spark.skins.mobile.TextAreaSkin;
 			
 			public var conn:SQLConnection;
 			public var db:File;
@@ -41,7 +42,8 @@ limitations under the License.
 				conn.openAsync(db);
 			}
 			
-			private function loadEntries():void{
+			private function loadEntries():void
+			{
 				myStatement = new SQLStatement();
 				myStatement.sqlConnection = conn;
 				myStatement.addEventListener(SQLEvent.RESULT, openDatabaseResult);				
@@ -50,7 +52,8 @@ limitations under the License.
 				myStatement.execute();
 			}
 			
-			private function openDatabaseHandler(event:SQLEvent):void{
+			private function openDatabaseHandler(event:SQLEvent):void
+			{
 				myStatement = new SQLStatement();
 				myStatement.sqlConnection = conn;
 				myStatement.addEventListener(SQLEvent.RESULT, loadDatabaseResult);				
@@ -59,26 +62,30 @@ limitations under the License.
 				myStatement.execute();
 			}
 			
-			private function loadDatabaseResult(event:SQLEvent):void{
+			private function loadDatabaseResult(event:SQLEvent):void
+			{
 				loadEntries();
 			}
 			
-			private function openDatabaseResult(event:SQLEvent):void{
-				var itemsArray:Array = new Array();
-				
+			private function openDatabaseResult(event:SQLEvent):void
+			{
+				var itemsArray:Array = new Array();		
 				var result:SQLResult = myStatement.getResult();
 				
-				if(result.data != null){
-					for(var i:int = 0; i<result.data.length; i++){
+				if(result.data != null)
+				{
+					for(var i:int = 0; i<result.data.length; i++)
+					{
 						itemsArray.push({label:unescape(result.data[i].itemText)});					
 					}
 				}
-							
+				
 				itemsCollection = new ArrayCollection(itemsArray);
 				itemsList.dataProvider = itemsCollection;
 			}
 			
-			private function modifyDatabaseResult(event:SQLEvent):void{
+			private function modifyDatabaseResult(event:SQLEvent):void
+			{
 				loadEntries();
 			}
 			
@@ -100,9 +107,12 @@ limitations under the License.
 			
 			protected function buttonHandler(event:MouseEvent):void
 			{
-				if(currentState == "DemoState"){
+				if(currentState == "DemoState")
+				{
 					currentState = "InfoState";				
-				}else if(currentState == "InfoState"){
+				}
+				else if(currentState == "InfoState")
+				{
 					currentState = "DemoState";
 				}
 			}
@@ -116,17 +126,20 @@ limitations under the License.
 	</s:states>
 	
 	<fx:Declarations>
-		<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" source320dpi="@Embed('assets/icons/320/about.png')"/>
-		<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" source320dpi="@Embed('assets/icons/320/dock.png')"/>
+		<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" 
+								source320dpi="@Embed('assets/icons/320/about.png')" source480dpi="assets/icons/480/about.png"/>
+		<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" 
+								source320dpi="@Embed('assets/icons/320/dock.png')" source480dpi="assets/icons/480/dock.png"/>
 		<s:ArrayCollection id="itemsCollection"/>
 	</fx:Declarations>
 	
-	<s:TextInput id="textInput" includeIn="DemoState" enter="addItemHandler()" skinClass="spark.skins.mobile.TextInputSkin" y="10" left="5" right="60" height="40"/>
+	<s:TextInput id="textInput" includeIn="DemoState" enter="addItemHandler()" y="10" left="5" right="60" height="40"/>
 	<s:Button label="Add" y="10" includeIn="DemoState" width="50" height="40" right="5" click="addItemHandler()"/>
 	
 	<s:List id="itemsList" includeIn="DemoState" width="100%" bottom="0" top="60"/>
 	
-	<s:TextArea includeIn="InfoState" skinClass="spark.skins.mobile.TextAreaSkin" left="10" right="10" top="10" bottom="10" editable="false" text="A SQLConnection instance is used to manage the creation of and connection to local SQL database files (local databases).
+	<s:TextArea includeIn="InfoState" selectable="false" left="10" right="10" top="10" bottom="10" editable="false" 
+				text="A SQLConnection instance is used to manage the creation of and connection to local SQL database files (local databases).
 				&#xd; &#xd;The functionality of the SQLConnection class falls into several categories:
 				
 				&#xd; &#xd;A local SQL database file is created or opened by calling the open() method or the SQLConnection instance to the SQLStatement's sqlConnection property.

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/TourDeFlexMobile-app.xml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/TourDeFlexMobile-app.xml b/tourdeflexmobile/src/TourDeFlexMobile-app.xml
index e9667b6..42a1e10 100644
--- a/tourdeflexmobile/src/TourDeFlexMobile-app.xml
+++ b/tourdeflexmobile/src/TourDeFlexMobile-app.xml
@@ -1,23 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="no"?>
-<!--
-
-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.
-
--->
-<application xmlns="http://ns.adobe.com/air/application/3.9">
+<application xmlns="http://ns.adobe.com/air/application/13.0">
 
 <!-- Adobe AIR Application Descriptor File Template.
 
@@ -154,25 +136,31 @@ limitations under the License.
 
 	<!-- The icon the system uses for the application. For at least one resolution,
 	specify the path to a PNG file included in the AIR package. Optional. -->
-	<!-- <icon>
-		<image16x16></image16x16>
+	<icon>	
+		<image48x48>assets/icons/icon48.png</image48x48>
+		<image72x72>assets/icons/icon72.png</image72x72>
+		<image96x96>assets/icons/icon96.png</image96x96>
+		<image144x144>assets/icons/icon144.png</image144x144>
+		<image512x512>assets/icons/icon512.png</image512x512>
+		<image1024x1024>assets/icons/icon1024.png</image1024x1024>
+		<!--image16x16></image16x16>
 		<image29x29></image29x29>
 		<image32x32></image32x32>
 		<image36x36></image36x36>
-		<image48x48></image48x48>
+		<image40x40></image40x40>
 		<image50x50></image50x50>
 		<image57x57></image57x57>
-		<image58x58></image58x58>
-		<image72x72></image72x72>
-		<image96x96></image96x96>
+		<image58x58></image58x58>		
+		<image76x76></image76x76>
+		<image80x80></image80x80>	
 		<image100x100></image100x100>
 		<image114x114></image114x114>
-		<image128x128></image128x128>
-		<image144x144></image144x144>
-		<image512x512></image512x512>
+		<image120x120></image120x120>
+		<image128x128></image128x128>		
+		<image152x152></image152x152>		
 		<image732x412></image732x412>
-		<image1024x1024></image1024x1024>
-	</icon> -->
+		-->
+	</icon>
 
 	<!-- Whether the application handles the update when a user double-clicks an update version
 	of the AIR file (true), or the default AIR application installer handles the update (false).
@@ -281,19 +269,20 @@ limitations under the License.
 			<manifest android:installLocation="auto">
 			    <!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
 			    <!--Removing the permission android.permission.INTERNET will have the side effect
-					of preventing you from debugging your application on your device-->
+		of preventing you from debugging your application on your device-->
 			    <uses-permission android:name="android.permission.INTERNET"/>
 			    <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
 			    <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
-			    <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
+			    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
 			    <!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
-					in order to access AIR's SystemIdleMode APIs-->
+		in order to access AIR's SystemIdleMode APIs-->
 			    <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
 			    <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
-			    <!--<uses-permission android:name="android.permission.CAMERA"/>-->
+			    <uses-permission android:name="android.permission.CAMERA"/>
+			    <uses-feature android:name="android.hardware.camera.autofocus"/>
 			    <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
 			    <!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
-					together in order to use AIR's NetworkInfo APIs-->
+		together in order to use AIR's NetworkInfo APIs-->
 			    <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
 			    <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
 			</manifest>

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/015a6901/tourdeflexmobile/src/TourDeFlexMobile.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/TourDeFlexMobile.mxml b/tourdeflexmobile/src/TourDeFlexMobile.mxml
index ab09404..21a8f0e 100644
--- a/tourdeflexmobile/src/TourDeFlexMobile.mxml
+++ b/tourdeflexmobile/src/TourDeFlexMobile.mxml
@@ -20,13 +20,14 @@ limitations under the License.
 
 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
 			   xmlns:s="library://ns.adobe.com/flex/spark" 
-			   applicationDPI="160" 
-			   applicationComplete="init(event)">
-	
-	<fx:Style source="styles.css"/>
-	
+			   applicationDPI="160" frameRate="60"
+			   applicationComplete="init(event)"
+			   splashScreenImage="@Embed('assets/images/poweredby.png')" 
+			   splashScreenScaleMode="letterbox">
+	<fx:Style source="styles.css"/>	
 	<fx:Script>
 		<![CDATA[
+			
 			import flash.events.Event;
 			import flash.events.MouseEvent;
 			import flash.events.TimerEvent;
@@ -38,6 +39,8 @@ limitations under the License.
 			import spark.events.IndexChangeEvent;
 			
 			import AIRViews.AccelerometerView;
+			import AIRViews.CameraView;
+			import AIRViews.GeolocationView;
 			import AIRViews.SQLiteView;
 			
 			import LayoutViews.AccordionLayoutView;
@@ -48,11 +51,13 @@ limitations under the License.
 			import LayoutViews.TileLayoutView;
 			import LayoutViews.TimeMachineLayoutView;
 			import LayoutViews.VerticalLayoutView;
+			import LayoutViews.StackLayoutView;
 			
 			import UIViews.ButtonBarView;
 			import UIViews.CalloutButtonView;
 			import UIViews.CheckboxView;
 			import UIViews.DateSpinnerView;
+			import UIViews.HscrubberView;
 			import UIViews.ListView;
 			import UIViews.MobileGridView;
 			import UIViews.RadiobuttonView;
@@ -62,203 +67,196 @@ limitations under the License.
 			
 			import views.HttpServiceView;
 			
-			public static var SLIDE_INTERVAL:int = 40;			
-			public static var STEPS:int = 6; 
-			
-			protected var _slideTimer:Timer = new Timer(SLIDE_INTERVAL, STEPS);
-			public static const CLICKED:String = "slideOutClicked";
-			protected var _buttonEnabled:Boolean = true;
-			protected var _startX:Number;
+			private var isOpen:Boolean;	
 			
 			
 			protected function init(event:FlexEvent):void
 			{
-				stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); 
-				btn.addEventListener(MouseEvent.CLICK, slideButtonHandler);
-				_slideTimer.addEventListener(TimerEvent.TIMER, doSlide);		
-				_slideTimer.addEventListener(TimerEvent.TIMER_COMPLETE, slideComplete); 				
+				stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); 			
+				lateralMenu.x = lateralMenu.width * -1;
 			}
 			
-			/*******************************************
-			 *used some code from Macomponents UISlideOutNavigation, replaced the actionscript elements with flex UI elements and was able to apply
-			 *the same drag to close behavior
-			 *********************************************/  
-			
-			public function open(animated:Boolean = true):void 
-			{				
-				if (!navigators.mouseEnabled)					
-					return;				
-				navigators.mouseEnabled = navigators.mouseChildren = false;				
-				if (animated) 
-				{					
-					_slideTimer.repeatCount = Math.max(Math.floor(STEPS * (1 - navigators.x / lateralMenu.width)), 1);					
-					_slideTimer.reset();				
-					_slideTimer.start();	
-				}					
-				else 
-				{	
-					navigators.x = lateralMenu.width;	
-					!navigators.mouseEnabled;
-				}		
-				stage.addEventListener(MouseEvent.CLICK, close);
-			}
-			
-			public function close(animated:Boolean = true):void 
-			{				
-				navigators.mouseEnabled = navigators.mouseChildren = true;				
-				if (animated) 
-				{					
-					_slideTimer.repeatCount = Math.max(Math.floor(STEPS * navigators.x / lateralMenu.width), 1);					
-					_slideTimer.reset();					
-					_slideTimer.start();					
-				}				
-				else 
-				{					
-					navigators.x = 0;				
-				}			
-			} 
-			
 			protected function changeHandler(event:IndexChangeEvent):void
 			{
-				close();
+				menuHandler();
 				navigator.pushView(componentsList.selectedItem.view);
 			}
 			
-			
-			
-			protected function slideButtonHandler(event:Event):void 
-			{				
-				dispatchEvent(new Event(CLICKED));				
-				navigators.mouseEnabled = navigators.mouseChildren = !navigators.mouseEnabled;		
-				if (_buttonEnabled) 
-				{					
-					_slideTimer.repeatCount = STEPS;				
-					_slideTimer.reset();				
-					_slideTimer.start();					
-				}
-				
-			}
-			
 			protected function mouseDown(event:MouseEvent):void 
 			{			
-				if (!navigators.mouseEnabled && mouseX > lateralMenu.width && mouseY > 45) 
-				{					
-					_startX = mouseX;				
-					stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);					
-					stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);			
-				}	
-				if (navigators.mouseEnabled && mouseX < 20)
+				//	if (!navigator.mouseEnabled && mouseX < 210 && mouseY > 45 && mouseY < navigator.height - 50) 
+				//	{								
+				//		lateralMenu.addEventListener(MouseEvent.MOUSE_UP, mouseUp);					
+				//		lateralMenu.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);			
+				//	}	
+				if (navigator.mouseEnabled && mouseX < 20 && mouseY > 45 && mouseY < navigator.height - 50)
 				{
-					_startX = mouseX;	
-					stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpOpen);	
-					stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveOpen);
+					stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpIn);	
+					stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseDownIn);
 				}
-			} 			
+			} 	
 			
-			protected function doSlide(event:TimerEvent):void 
+			/*	protected function mouseMove(event:MouseEvent):void 
 			{				
-				var slideTimer:Timer = Timer(event.currentTarget);				
-				var t:Number = slideTimer.currentCount/slideTimer.repeatCount;			
-				navigators.x = (navigators.mouseEnabled ? (1-t) : t) * lateralMenu.width;				
-			} 
+			navigator.mouseEnabled = false;		
+			var myRectangle:Rectangle = new Rectangle(-215, 42, 215, 0);
+			lateralMenu.startDrag(false, myRectangle );
+			trace(lateralMenu.x)
+			//lateralMenu.addEventListener(MouseEvent.CLICK,suppressClick,true,9999,true);
 			
-			protected function slideComplete(event:TimerEvent):void 
-			{				
-				removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);	
-				navigators.mouseEnabled;
-				if (!navigators.mouseEnabled) 
-				{					
-					addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);					
-				}				
-			} 
-			
-			protected function mouseMove(event:MouseEvent):void 
-			{							
-				
-				navigators.x = Math.max(Math.min(mouseX - _startX + lateralMenu.width, lateralMenu.width), 0);	
-				
 			} 
 			
 			protected function mouseUp(event:MouseEvent):void 
 			{		
-				stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);				
-				stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);				
-				navigators.mouseEnabled = navigators.mouseChildren = mouseX < lateralMenu.width / 2;			
-				_slideTimer.repeatCount = Math.max(navigators.mouseEnabled ? Math.floor(STEPS * navigators.x / lateralMenu.width) : Math.floor(STEPS * (1 - navigators.x / lateralMenu.width)), 1);				
-				_slideTimer.reset();				
-				_slideTimer.start();
-				
+			
+			if (lateralMenu.x < -65) 
+			{
+			lateralMenu.stopDrag();
+			lateralMenu.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);				
+			lateralMenu.removeEventListener(MouseEvent.MOUSE_DOWN, mouseMove);					
+			moveOut.play();
+			isOpen == false;					
+			}
+			if (lateralMenu.x > -65) 
+			{
+			lateralMenu.stopDrag();
+			moveIn.play();
+			isOpen == true;					
 			}
+			lateralMenu.stopDrag();	
+			}	*/	
+			
 			
-			protected function mouseMoveOpen(event:MouseEvent):void 
+			
+			protected function mouseDownIn(event:MouseEvent):void 
 			{				
-				navigators.mouseEnabled = navigators.mouseChildren = false;		
-				navigators.x = Math.max(Math.min(mouseX + _startX, lateralMenu.width), 0);				
+				//define area for lateralMenu to travel
+				var myRectangle:Rectangle = new Rectangle(-215, 42, 215, 0);
+				lateralMenu.startDrag(false, myRectangle );	
+				obfuscationGroup.visible = true;
+				obfuscationLayer.alpha = (lateralMenu.x + 216) * .47 / 200	
+				trace(obfuscationLayer.alpha);
 			} 
 			
-			protected function mouseUpOpen(event:MouseEvent):void 
+			protected function mouseUpIn(event:MouseEvent):void 
 			{		
-				stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp1);
-				stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove1);						
-				navigators.mouseEnabled = navigators.mouseChildren = mouseX < lateralMenu.width / 2;
-				_slideTimer.repeatCount = Math.max(navigators.mouseEnabled ? Math.floor(STEPS * navigators.x / lateralMenu.width) : Math.floor(STEPS * (1 - navigators.x / lateralMenu.width)), 1);		
-				_slideTimer.reset();				
-				_slideTimer.start();
-				
-				
+				if (lateralMenu.x > -115) 
+				{
+					lateralMenu.stopDrag();
+					stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpIn);
+					stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseDownIn);
+					moveIn.play();
+					isOpen == true;	
+					currentState = "closed";
+				}
+				if (lateralMenu.x < -115) 
+				{
+					lateralMenu.stopDrag();
+					moveOut.play();
+					isOpen == false;	
+					obfuscationGroup.visible = false;
+					currentState = "open";
+				}
+				lateralMenu.stopDrag();
+			}
+			
+			protected function menuHandler():void
+			{
 				
+				if(lateralMenu.x == 0)
+				{
+					obfuscationGroup.visible = false;
+					parallelOut.play();			
+					isOpen = false;
+					currentState = "open";
+				} 
+				else if(lateralMenu.x == -215)
+				{
+					obfuscationGroup.visible = true;
+					parallelIn.play();		
+					isOpen = true;
+					currentState = "closed";
+				}
 			}
+			
 		]]>
 	</fx:Script>
-	
+	<s:states>
+		<s:State name="open"/>
+		<s:State name="closed"/>	
+	</s:states>
 	<fx:Declarations>
-		
+		<s:Parallel id="parallelIn">
+			<s:Fade id="fadeIn" target="{obfuscationLayer}" alphaFrom="0" alphaTo=".5" duration="300"/>
+			<s:Move id="moveIn" duration="300" target="{lateralMenu}" xTo="0"/>
+		</s:Parallel>
+		<s:Parallel id="parallelOut">
+			<s:Fade id="fadeOut" target="{obfuscationLayer}" alphaFrom=".5" alphaTo="0" duration="300"/>
+			<s:Move id="moveOut" duration="300" target="{lateralMenu}" xTo="-215"/>
+		</s:Parallel>
+		<s:MultiDPIBitmapSource source640dpi="@Embed('assets/icons/640/icon.png')" id="iconOpen" 
+								source480dpi="@Embed('assets/icons/480/icon.png')" 
+								source320dpi="@Embed('assets/icons/320/icon.png')" 
+								source240dpi="@Embed('assets/icons/240/icon.png')"
+								source160dpi="@Embed('assets/icons/160/icon.png')"/>
+		<s:MultiDPIBitmapSource source640dpi="@Embed('assets/icons/640/icon1.png')" id="iconClose" 
+								source480dpi="@Embed('assets/icons/480/icon1.png')" 
+								source320dpi="@Embed('assets/icons/320/icon1.png')" 
+								source240dpi="@Embed('assets/icons/240/icon1.png')"
+								source160dpi="@Embed('assets/icons/160/icon1.png')"/>
 	</fx:Declarations>
-	
-	
-	
-	<s:Group id="lateralMenu" width="225" y="0" height="100%">
-		
-		<s:List id="componentsList" itemRenderer="renderers.MenuRenderer" width="225" height="100%" 
-				change="changeHandler(event)" contentBackgroundColor="#000000">
+	<s:ViewNavigator id="navigator" firstView="views.BlogView" width="100%" height="100%">
+		<s:navigationContent>
+			<s:Button icon.open="{iconOpen}" icon.closed="{iconClose}" id="btn" click="menuHandler()"/>
+		</s:navigationContent>
+	</s:ViewNavigator>
+	<s:Group width="100%" height="100%" click="menuHandler()" id="obfuscationGroup" y="43" visible="false"> 
+		<s:Rect id="obfuscationLayer" width="100%" height="100%" alpha="0">
+			<s:fill >
+				<s:SolidColor color="0x000000" />
+			</s:fill>
+		</s:Rect>
+	</s:Group>
+	<s:Group id="lateralMenu" width="215" y="43" height="100%">
+		<s:RectangularDropShadow left="0" right="0" top="0" bottom="0" alpha=".4" distance="5" angle="90" 
+								 blurX="5" blurY="5" color="0x000000"/>
+		<s:List id="componentsList" itemRenderer="renderers.MenuRenderer" width="215" height="100%" styleName="RobotoEmbedded" 
+				change="changeHandler(event)" contentBackgroundColor="#eeeeee" downColor="#e0e0e0" selectionColor="#33B5E5">
 			<s:ArrayList>
-				<fx:Object label="UI Components" type="separator"/>			
+				<fx:Object label="UI COMPONENTS" type="separator"/>			
 				<fx:Object label="ButtonBar" type="view" view="{ButtonBarView}"/>
 				<fx:Object label="CalloutButton" type="view" view="{CalloutButtonView}"/>
 				<fx:Object label="CheckBox" type="view" view="{CheckboxView}"/>
 				<fx:Object label="DateSpinner" type="view" view="{DateSpinnerView}"/>
+				<fx:Object label="HSlider" type="view" view="{HscrubberView}"/>
 				<fx:Object label="List" type="view" view="{ListView}"/>
 				<fx:Object label="MobileGrid" type="view" view="{MobileGridView}"/>
 				<fx:Object label="RadioButton" type="view" view="{RadiobuttonView}"/>
 				<fx:Object label="SpinnerList" type="view" view="{SpinnerListView}"/>
-				<fx:Object label="TextInput" type="view" view="{TextInputView}"/>
+				<fx:Object label="TextInput" type="view" view="{TextInputView}"/>			
 				<fx:Object label="ToggleSwitch" type="view" view="{ToggleSwitchView}"/>
 				
-				<fx:Object label="Layouts" type="separator"/>				
-				<fx:Object label="HorizontalLayout" type="view" view="{HorizontalLayoutView}"/>
-				<fx:Object label="VerticalLayout" type="view" view="{VerticalLayoutView}"/>
-				<fx:Object label="TileLayout" type="view" view="{TileLayoutView}"/>
-				<fx:Object label="CoverFlowLayout" type="view" view="{CoverFlowLayoutView}"/>
-				<fx:Object label="TimeMachineLayout" type="view" view="{TimeMachineLayoutView}"/>
-				<fx:Object label="RolodexLayout" type="view" view="{RolodexLayoutView}"/>
-				<fx:Object label="CarouselLayout" type="view" view="{CarouselLayoutView}"/>
-				<fx:Object label="AccordionLayout" type="view" view="{AccordionLayoutView}"/>
+				<fx:Object label="LAYOUTS" type="separator"/>	
+				<fx:Object label="Accordion Layout" type="view" view="{AccordionLayoutView}"/>
+				<fx:Object label="Carousel Layout" type="view" view="{CarouselLayoutView}"/>
+				<fx:Object label="CoverFlow Layout" type="view" view="{CoverFlowLayoutView}"/>
+				<fx:Object label="Horizontal Layout" type="view" view="{HorizontalLayoutView}"/>
+				<fx:Object label="Rolodex Layout" type="view" view="{RolodexLayoutView}"/>
+				<fx:Object label="Stack Layout" type="view" view="{StackLayoutView}"/>
+				<fx:Object label="Tile Layout" type="view" view="{TileLayoutView}"/>						
+				<fx:Object label="TimeMachine Layout" type="view" view="{TimeMachineLayoutView}"/>
+				<fx:Object label="Vertical Layout" type="view" view="{VerticalLayoutView}"/>
 				
-				<fx:Object label="AIR APIs" type="separator"/>				
-				<fx:Object label="SQLite" type="view" view="{SQLiteView}"/>
+				<fx:Object label="AIR APIs" type="separator"/>								
 				<fx:Object label="Accelerometer" type="view" view="{AccelerometerView}"/>
+				<!--fx:Object label="Camera" type="view" view="{CameraView}"/-->
+				<fx:Object label="Geolocation" type="view" view="{GeolocationView}"/>
+				<fx:Object label="SQLite" type="view" view="{SQLiteView}"/>
 				
-				<fx:Object label="Data Access" type="separator"/>			
+				<fx:Object label="DATA ACCESS" type="separator"/>			
 				<fx:Object label="HTTPService" type="view" view="{HttpServiceView}"/>
 			</s:ArrayList>
 		</s:List>
 	</s:Group>
 	
-	<s:Group id="navigators" width="{FlexGlobals.topLevelApplication.width}" height="{FlexGlobals.topLevelApplication.height}" >
-		<s:ViewNavigator id="navigator" firstView="views.BlogView" width="100%" height="100%">
-			<s:navigationContent>
-				<s:Button icon="@Embed('assets/images/logo.png')" height="35" width="77" label="Menu" id="btn"/>
-			</s:navigationContent>
-		</s:ViewNavigator>
-	</s:Group>
 </s:Application>