flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [35/50] [abbrv] git commit: [flex-utilities] [refs/heads/master] - embed XML rather that load at run time so it can work with local paths
Date Sat, 23 Aug 2014 04:45:42 GMT
embed XML rather that load at run time so it can work with local paths


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/8ded4b16
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/8ded4b16
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/8ded4b16

Branch: refs/heads/master
Commit: 8ded4b16573af6c8712fab45d744bc29e2eff04b
Parents: b352424
Author: Justin Mclean <jmclean@apache.org>
Authored: Mon Aug 18 14:36:50 2014 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Mon Aug 18 14:36:50 2014 +1000

----------------------------------------------------------------------
 .../itemRenderers/ItemRenderer1Example.mxml     | 25 ++++++++++----------
 .../itemRenderers/ItemRenderer2Example.mxml     | 20 ++++++++--------
 2 files changed, 22 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8ded4b16/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer1Example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer1Example.mxml b/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer1Example.mxml
index c83b860..3c21155 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer1Example.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer1Example.mxml
@@ -20,31 +20,30 @@
 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
 			   xmlns:s="library://ns.adobe.com/flex/spark" 
 			   xmlns:mx="library://ns.adobe.com/flex/mx" 
-			   applicationComplete="srv.send()">
+			   initialize="init()">
 	
 	
 	<fx:Script>
 		<![CDATA[
-			import mx.collections.ArrayCollection;
-			import mx.rpc.events.ResultEvent;
+			import mx.collections.XMLListCollection;
 			
 			import skins.TDFPanelSkin;
 			
 			[Bindable]
-			private var employees:ArrayCollection;
+			private var employees:XMLListCollection;
 			
-			private function resultHandler(event:ResultEvent):void
-			{
-				employees = event.result.list.employee as ArrayCollection;
-			}
+			[Embed(source="data/list.xml", mimeType="application/octet-stream")]
+			private var XMLData:Class;
 			
+			private function init():void
+			{
+				var data:XML = XML(new XMLData());
+				
+				employees = new XMLListCollection(data.employee);
+			}			
 		]]>
 	</fx:Script>
-	
-	<fx:Declarations>
-		<s:HTTPService id="srv" url="./data/list.xml" result="resultHandler(event)"/>
-	</fx:Declarations>
-	
+
 	<s:Panel width="100%" height="100%" title="Custom Item Renderer with Animation" skinClass="skins.TDFPanelSkin">
 		<s:layout>
 			<s:HorizontalLayout paddingLeft="100" paddingRight="10" paddingTop="10" paddingBottom="10"/>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8ded4b16/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer2Example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer2Example.mxml b/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer2Example.mxml
index d418326..29ab4ca 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer2Example.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/itemRenderers/ItemRenderer2Example.mxml
@@ -20,7 +20,7 @@
 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
 			   xmlns:s="library://ns.adobe.com/flex/spark" 
 			   xmlns:mx="library://ns.adobe.com/flex/mx" 
-			   applicationComplete="srv.send()">
+			   initialize="init()">
 	
 	<fx:Style>
 
@@ -35,23 +35,23 @@
 	
 	<fx:Script>
 		<![CDATA[
-			import mx.collections.ArrayCollection;
-			import mx.rpc.events.ResultEvent;
+			import mx.collections.XMLListCollection;
 			
 			[Bindable]
-			private var employees:ArrayCollection;
+			private var employees:XMLListCollection;
 			
-			private function resultHandler(event:ResultEvent):void
+			[Embed(source="data/list.xml", mimeType="application/octet-stream")]
+			private var XMLData:Class;
+			
+			private function init():void
 			{
-				employees = event.result.list.employee as ArrayCollection;
+				var data:XML = XML(new XMLData());
+				
+				employees = new XMLListCollection(data.employee);
 			}
-			
 		]]>
 	</fx:Script>
 	
-	<fx:Declarations>
-		<s:HTTPService id="srv" url="./data/list.xml" result="resultHandler(event)"/>
-	</fx:Declarations>
 	<s:Panel width="100%" height="100%" title="Custom Item Renderer with Animation" skinClass="skins.TDFPanelSkin">
 		<s:layout>
 			<s:HorizontalLayout paddingTop="2" paddingLeft="50" paddingRight="8"/>


Mime
View raw message