incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1369975 [4/5] - in /incubator/flex/trunk/mustella/tests/Modules: ./ Constraints/ Constraints/Properties/ Constraints/SWFs/ Constraints/SWFs/comps/ Fonts/ Fonts/SWFs/ Fonts/SWFs/assets/ Fonts/tests/ Fonts/tests/baselines/ RSLs/ RSLs/Integra...
Date Mon, 06 Aug 2012 20:21:29 GMT
Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/Integration/checkModules.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/Integration/checkModules.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/Integration/checkModules.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/Integration/checkModules.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+<UnitTester testDir="Modules/RSLs/Integration/"  xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="MainApp.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+	<![CDATA[
+		public static function init(o:DisplayObject):void
+		{
+		}
+		]]>
+	</fx:Script>
+
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+	]]>
+	</fx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<testCases>
+		<TestCase testID="modulesRSLs" keywords="[RSL,Module]" description="Test for module when using rsl" >
+		    <setup>
+			<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		    </setup>
+
+		    <body>		
+			<CompareBitmap url="../Integration/baselines/$testID_comboModule.png" target="comboModule" numColorVariances="10" ignoreMaxColorVariance="true" />
+			<CompareBitmap url="../Integration/baselines/$testID_dataGrid.png" target="dataGrid" numColorVariances="10" ignoreMaxColorVariance="true"/>
+			<CompareBitmap url="../Integration/baselines/$testID_anotherDataGrid.png" target="anotherDataGrid" numColorVariances="10" ignoreMaxColorVariance="true"/>
+		    </body>
+		</TestCase>
+	</testCases>
+
+</UnitTester>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.compile
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.compile?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.compile (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.compile Mon Aug  6 20:21:26 2012
@@ -0,0 +1 @@
+-theme+=${flexlib}/projects/spark/MXFTEText.css
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/MainApp.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,100 @@
+<?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: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"
+	backgroundColor="0xffffff"
+	>
+<fx:Style>
+ 	@namespace mx "library://ns.adobe.com/flex/mx";
+	@namespace s "library://ns.adobe.com/flex/spark";	
+		
+		@font-face{
+			src: url("../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
+			fontFamily: myVeraSpark;
+			embedAsCFF: true;
+		}
+		@font-face{
+			src: url("../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
+			fontWeight: bold;
+			fontFamily: myVeraSpark;
+			embedAsCFF: true;
+		}
+
+		@font-face{
+			src: url("../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
+			fontStyle: italic;
+			fontFamily: myVeraSpark;
+			embedAsCFF: true;
+		}
+		@font-face{
+			src: url("../../../../Assets/Fonts/Open_Sans/OpenSans-BoldItalic.ttf");
+			fontWeight: bold;
+    			fontStyle: italic;
+			fontFamily: myVeraSpark;
+			embedAsCFF: true;
+		}
+	
+		global {
+		    fontFamily: "myVeraSpark";
+		    fontAntiAliasType: "normal";
+		}
+
+	 	
+</fx:Style>
+	<s:layout> <s:VerticalLayout/> </s:layout>
+	
+	<fx:Script>
+		<![CDATA[
+			import mx.events.ModuleEvent;	
+			import mx.controls.Alert;	
+			import mx.managers.DragManager;
+			private var placeholder: DragManager;
+
+			private function errorHandler(e:ModuleEvent):void
+			{
+				Alert.show(e.errorText);
+			}
+			
+		]]>
+	</fx:Script>	
+		
+	<s:Button label="Unload ComboModule" 
+		click="comboModule.unloadModule();" />
+		
+	<s:Button label="Unload DataGrid" 
+		click="dataGrid.unloadModule();" />
+		
+	<s:Button label="Unload AnotherDataGrid" 
+		click="anotherDataGrid.unloadModule();" />
+	<mx:Spacer />
+	
+	<s:Button label="Load ComboModule" click="comboModule.loadModule();" />
+	<s:Button label="Load DataGrid" click="dataGrid.loadModule();" />
+	<s:Button label="Load AnotherDataGrid" click="anotherDataGrid.loadModule();" />
+	
+	<mx:HBox>
+		<mx:ModuleLoader id="comboModule" url="assets/ComboModule.swf" error="errorHandler(event)"/>
+		<mx:ModuleLoader id="dataGrid" url="assets/DataGridModule.swf" error="errorHandler(event)"/>
+		<mx:ModuleLoader id="anotherDataGrid" url="assets/AnotherDataGridModule.swf" error="errorHandler(event)"/>	
+	</mx:HBox>
+	
+</s:Application>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule-config.xml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule-config.xml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule-config.xml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,26 @@
+<?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.
+
+-->
+<flex-config xmlns="http://www.adobe.com/2006/flex-config">
+   <runtime-shared-library-path>
+     <path-element>${flexlib}/libs/framework.swc</path-element>
+     <rsl-url>assets/framework_4.5.0.${build.number}.swf</rsl-url>
+   </runtime-shared-library-path>
+   <static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
+</flex-config>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.compile
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.compile?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.compile (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.compile Mon Aug  6 20:21:26 2012
@@ -0,0 +1 @@
+-theme+=${flexlib}/projects/spark/MXFTEText.css
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/AnotherDataGridModule.mxml Mon Aug  6 20:21:26 2012
@@ -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.
+
+-->
+<mx:Module width="800" height="600"
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+	
+	<mx:Script>
+        <![CDATA[
+            import mx.collections.ArrayCollection;
+                  
+            [Bindable]
+            private var dpFlat:ArrayCollection = new ArrayCollection([
+              {Region:"Southwest", Territory:"Arizona", 
+                  Territory_Rep:"Barbara U", Actual:38865, Estimate:40000}, 
+              {Region:"Southwest", Territory:"Arizona", 
+                  Territory_Rep:"Dana V", Actual:29885, Estimate:30000},  
+              {Region:"Southwest", Territory:"Central California", 
+                  Territory_Rep:"Joe W", Actual:29134, Estimate:30000},  
+              {Region:"Southwest", Territory:"Nevada", 
+                  Territory_Rep:"Bethany X", Actual:52888, Estimate:45000},  
+              {Region:"Southwest", Territory:"Northern California", 
+                  Territory_Rep:"Lauren Y", Actual:38805, Estimate:40000}, 
+              {Region:"Southwest", Territory:"Northern California", 
+                  Territory_Rep:"T.R. Z", Actual:55498, Estimate:40000},  
+              {Region:"Southwest", Territory:"Southern California", 
+                  Territory_Rep:"Alice Q", Actual:44985, Estimate:45000}, 
+              {Region:"Southwest", Territory:"Southern California", 
+                  Territory_Rep:"Jane T", Actual:44913, Estimate:45000}
+            ]);
+        ]]>
+    </mx:Script>
+
+    <mx:Panel title="DataGrid Control Example"
+        height="75%" width="75%" layout="horizontal"
+        paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
+
+        <mx:DataGrid id="myADG" 
+            width="100%" height="100%" 
+            dataProvider="{dpFlat}">        
+            <mx:columns>
+                <mx:DataGridColumn dataField="Region"/>
+                <mx:DataGridColumn dataField="Territory"/>
+                <mx:DataGridColumn dataField="Territory_Rep"
+                    headerText="Territory Rep"/>
+                <mx:DataGridColumn dataField="Actual"/>
+                <mx:DataGridColumn dataField="Estimate"/>
+            </mx:columns>
+       </mx:DataGrid>
+    </mx:Panel>
+
+
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule-config.xml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule-config.xml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule-config.xml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,26 @@
+<?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.
+
+-->
+<flex-config xmlns="http://www.adobe.com/2006/flex-config">
+   <runtime-shared-library-path>
+     <path-element>${flexlib}/libs/framework.swc</path-element>
+     <rsl-url>assets/framework_4.5.0.${build.number}.swf</rsl-url>
+   </runtime-shared-library-path>
+   <static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
+</flex-config>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.compile
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.compile?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.compile (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.compile Mon Aug  6 20:21:26 2012
@@ -0,0 +1 @@
+-theme+=${flexlib}/projects/spark/MXFTEText.css
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/ComboModule.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,44 @@
+<?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.
+
+-->
+<mx:Module width="300" height="300"
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+	
+	<mx:Script>
+        <![CDATA[          
+        import mx.collections.ArrayCollection;
+
+        [Bindable]
+        private var medalsAC:ArrayCollection = new ArrayCollection( [
+            { Country: "USA" },
+            { Country: "China" },
+            { Country: "Russia"  } ]);
+    
+        ]]>
+    </mx:Script>
+	
+	<mx:ComboBox id="chart" 
+        height="100%" 
+        width="100%"
+        paddingRight="5" 
+        paddingLeft="5" 
+        labelField = "Country"
+        dataProvider="{medalsAC}"/>          
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule-config.xml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule-config.xml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule-config.xml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,26 @@
+<?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.
+
+-->
+<flex-config xmlns="http://www.adobe.com/2006/flex-config">
+   <runtime-shared-library-path>
+     <path-element>${flexlib}/libs/framework.swc</path-element>
+     <rsl-url>assets/framework_4.5.0.${build.number}.swf</rsl-url>
+   </runtime-shared-library-path>
+   <static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
+</flex-config>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.compile
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.compile?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.compile (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.compile Mon Aug  6 20:21:26 2012
@@ -0,0 +1 @@
+-theme+=${flexlib}/projects/spark/MXFTEText.css
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/assets/DataGridModule.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,79 @@
+<?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.
+
+-->
+<mx:Module width="640" height="480"
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+	
+	<mx:XMLList id="employees">
+        <employee>
+            <name>Christina W</name>
+            <phone>555-219-2270</phone>
+            <email>cq@fictitious.com</email>
+            <active>true</active>
+        </employee>
+        <employee>
+            <name>Joanne X</name>
+            <phone>555-219-2012</phone>
+            <email>jx@fictitious.com</email>
+            <active>true</active>
+        </employee>
+        <employee>
+            <name>Maurice Y</name>
+            <phone>555-219-2012</phone>
+            <email>my@fictitious.com</email>
+            <active>false</active>
+        </employee>
+        <employee>
+            <name>Mary Z</name>
+            <phone>555-219-2000</phone>
+            <email>mz@fictitious.com</email>
+            <active>true</active>
+        </employee>
+    </mx:XMLList>
+
+    <mx:Panel title="DataGrid Control Example" height="100%" width="100%" 
+        paddingTop="10" paddingLeft="10" paddingRight="10">
+
+        <mx:Label width="100%" color="blue"
+            text="Select a row in the DataGrid control."/>
+
+        <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}">
+            <mx:columns>
+                <mx:DataGridColumn dataField="name" headerText="Name"/>
+                <mx:DataGridColumn dataField="phone" headerText="Phone"/>
+                <mx:DataGridColumn dataField="email" headerText="Email"/>
+            </mx:columns>
+        </mx:DataGrid>
+
+        <mx:Form width="100%" height="100%">
+            <mx:FormItem label="Name">
+                <mx:Label text="{dg.selectedItem.name}"/>
+            </mx:FormItem>
+            <mx:FormItem label="Email">
+                <mx:Label text="{dg.selectedItem.email}"/>
+            </mx:FormItem>
+            <mx:FormItem label="Phone">
+                <mx:Label text="{dg.selectedItem.phone}"/>
+            </mx:FormItem>
+        </mx:Form>
+        
+    </mx:Panel>
+
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/pre_compile.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/pre_compile.sh?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/pre_compile.sh (added)
+++ incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/pre_compile.sh Mon Aug  6 20:21:26 2012
@@ -0,0 +1,36 @@
+#!/bin/sh
+################################################################################
+##
+##  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.
+##
+################################################################################
+rm -f `find . -name "lnkReport.xml"`
+
+$SDK_DIR/bin/mxmlc -link-report=lnkReport.xml -theme+=$SDK_DIR/frameworks/projects/spark/MXFTEText.css MainApp.mxml
+
+
+cd assets
+
+echo "Removing previously compiled files..."
+rm -f `find . -name "*.swf"`
+
+echo "Compiling module SWFs..."
+$SDK_DIR/bin/mxmlc -load-externs=../lnkReport.xml -theme+=$SDK_DIR/frameworks/projects/spark/MXFTEText.css -static-rsls=true AnotherDataGridModule.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../lnkReport.xml -theme+=$SDK_DIR/frameworks/projects/spark/MXFTEText.css -static-rsls=true DataGridModule.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../lnkReport.xml -theme+=$SDK_DIR/frameworks/projects/spark/MXFTEText.css -static-rsls=true ComboModule.mxml
+
+
+

Propchange: incubator/flex/trunk/mustella/tests/Modules/RSLs/SWFs/pre_compile.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester1.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester1.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,125 @@
+<?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.
+
+-->
+<UnitTester testDir="Modules/SubModules/Integration/"  xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" 
+testSWF="SubModuleTest_basic1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+	<![CDATA[
+		import mx.core.FlexGlobals;
+		import mx.managers.PopUpManager;
+		public static function init(o:DisplayObject):void
+		{
+		}
+		]]>
+	</fx:Script>
+
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+	]]>
+	</fx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<testCases>
+		
+		<TestCase testID="loadSubModule_module1" keywords="[SubModule, ModuleLoader]" description="load a sub module test using moduleLoader" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="0" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <DispatchMouseClickEvent target="moduleLoader1.child.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleLoader1.child" />
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subModuleLoader1.child.label1" value="SubModuleWithLabel loaded"/>
+		    	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+		
+		
+		
+		<TestCase testID="loadSubModule_module2" keywords="[SubModule, ModuleLoader]" description="load a sub module which uses PopUpManager, module is loaded by using moduleLoader" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="1" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <DispatchMouseClickEvent target="moduleLoader1.child.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleLoader1.child" />
+		        <!-- add some timeout so submodule can be loaded since the module loads a popup TitleWindow -->
+		        <Pause timeout="400"/>
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subModuleLoader1.child.tw.label1" value="SimpleTitleWindow loaded"/>
+		        <RunCode code="PopUpManager.removePopUp(FlexGlobals.topLevelApplication.moduleLoader1.child.subModuleLoader1.child.tw);" />
+		    	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+		
+		
+		<TestCase testID="loadSubModule_module3" keywords="[SubModule, ModuleLoader]" description="load a mxTitleWindow content subModule, module is loaded by using moduleLoader" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="2" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <DispatchMouseClickEvent target="moduleLoader1.child.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleLoader1.child" />
+		        
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subModuleLoader1.child.mxTW.label1" value="MXTitleWindow loaded"/>
+		    	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+		
+
+		
+		<TestCase testID="loadSubModule_module4" keywords="[SubModule, ModuleLoader]" description="load a subModule,module is loaded by using ModuleManager" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="3" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.ccm.label1" value="SubModuleWithLabel loaded"/>
+		      	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+
+		
+		<TestCase testID="loadSubModule_module5" keywords="[SubModule, ModuleLoader]" description="load a subModule,module is created in actionscript, loaded by using ModuleManager" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="4" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <DispatchMouseClickEvent target="moduleLoader1.child.b1" waitEvent="updateComplete" waitTarget="moduleLoader1.child.label1" />
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.label1" value="12"/>
+		      	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+		
+		
+	</testCases>
+
+</UnitTester>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester2.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester2.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,123 @@
+<?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.
+
+-->
+<UnitTester testDir="Modules/SubModules/Integration/"  xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" 
+testSWF="SubModuleTest_basic2.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+	<![CDATA[
+		import mx.core.FlexGlobals;
+		import mx.managers.PopUpManager;
+		public static function init(o:DisplayObject):void
+		{
+		}
+		]]>
+	</fx:Script>
+
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+	]]>
+	</fx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<testCases>
+		
+		<TestCase testID="loadSubModule_module1" keywords="[SubModule, ModuleManager]" description="load a module test using ModuleManager" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="0" waitEvent="valueCommit"  />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" />
+		        <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.label1" value="SubModuleWithLabel loaded"/>
+		        <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+		
+		
+		
+		<TestCase testID="loadSubModule_module2" keywords="[SubModule, ModuleManager]" description="load a sub module which uses PopUpManager, module is loaded by using ModuleManager" >
+		     <setup>
+			<RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" />
+			<SetProperty target="dg" propertyName="selectedIndex"  value="1" waitEvent="valueCommit"  />
+		   </setup>
+		    <body>
+			<DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+			<DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" />
+			<Pause timeout="200"/>
+			<AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.tw.label1" value="SimpleTitleWindow loaded"/>
+			<RunCode code="PopUpManager.removePopUp(FlexGlobals.topLevelApplication.moduleHolder.getChildAt(0).subModuleLoader1.child.tw);" />
+			<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		       
+		</TestCase>
+		
+		
+		<TestCase testID="loadSubModule_module3" keywords="[SubModule, ModuleManager]" description="load a mxTitleWindow content subModule, module is loaded by using ModuleManager" >
+		   <setup>
+			<RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" />
+			<SetProperty target="dg" propertyName="selectedIndex"  value="2" waitEvent="valueCommit"  />
+		   </setup>
+		    <body>
+			<DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+			<DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" />
+			<AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.mxTW.label1" value="MXTitleWindow loaded"/>
+			<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		        
+		</TestCase>
+		
+
+
+		<TestCase testID="loadSubModule_module4" keywords="[SubModule, ModuleManager]" description="load a subModule,module is loaded by using ModuleManager" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" />
+			<SetProperty target="dg" propertyName="selectedIndex"  value="3" waitEvent="valueCommit"  />
+		   </setup>
+		    <body>
+			<DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+			<Pause timeout="200"/>
+			<AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).ccm.label1" value="SubModuleWithLabel loaded"/>
+			<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		        
+		</TestCase>
+
+				
+		<TestCase testID="loadSubModule_module5" keywords="[SubModule, ModuleManager]" description="load a subModule,module is created in actionscript, loaded by using ModuleManager" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" />
+		    	<SetProperty target="dg" propertyName="selectedIndex"  value="4" waitEvent="valueCommit" />
+		   </setup>
+		    <body>
+		        <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" />
+		        <Pause timeout="500"/>
+		        <DispatchMouseClickEvent target="moduleHolder.getChildAt(0).b1" waitEvent="updateComplete" waitTarget="moduleHolder.getChildAt(0).label1" />
+		        <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).label1" value="12"/>
+		      	<DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" />
+		    </body>
+		</TestCase>
+	
+		
+	</testCases>
+
+</UnitTester>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester3.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/Integration/subModules_tester3.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,201 @@
+<?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.
+
+-->
+<UnitTester testDir="Modules/SubModules/Integration/"  xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" 
+testSWF="SubModuleTest_basic3.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+	<![CDATA[
+		import mx.core.FlexGlobals;
+		import mx.managers.PopUpManager;
+		import mx.managers.SystemManager;
+		
+		public var subAppRef2:SystemManager;
+		public static function init(o:DisplayObject):void
+		{
+		}
+		]]>
+	</fx:Script>
+
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+	]]>
+	</fx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<testCases>
+		
+		<TestCase testID="subAppWithSubModule_test1" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subapp=>moduleLoader=>module1(moduleLoaderr)=>submodule1(by moduleLoader);load a sub application which loads module, module loads a subModule which  is loaded by moduleLoader" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		        <RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');"  waitTarget="" waitEvent="SWFLoaded" />
+		        <Pause timeout="200"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" />
+		    	<Pause timeout="100"/>
+		    	<SetProperty target="subAppRef.document.dg" propertyName="selectedIndex"  value="0" />
+		    </setup>
+		    <body>
+		    	<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module1.swf')"/>
+		        <Pause timeout="200"/>
+		        <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.loadModule1()"/>
+		       <Pause timeout="200"/>
+		        <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.subModuleLoader1.child.label1" value="SubModuleWithLabel loaded"/>
+		    	<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/>
+		    </body>
+		</TestCase>
+	
+		
+		<TestCase testID="subAppWithSubModule_test2" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(moduleLoader)=>submodule1(by moduleManager):load a sub application,the subapp loads a module through moduleLoader, a submodule is loaded ModuleManager" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');"  waitTarget="" waitEvent="SWFLoaded" />
+		        <Pause timeout="200"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" />
+		    	<Pause timeout="100"/>
+		    	<SetProperty target="subAppRef.document.dg" propertyName="selectedIndex"  value="1" />
+		   </setup>
+		    <body>
+		        <Pause timeout="100"/>
+			<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module6.swf')"/>
+		        <Pause timeout="300"/>
+		        <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.loadModule1()"/>
+		        <Pause timeout="700"/>
+		        
+		        <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.subModuleLoader1.child.addNumbers(5,7)"/>
+		        
+		        <Pause timeout="200"/>
+		        <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.subModuleLoader1.child.label1" value="12"/>
+		        
+		        <Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/>
+		    </body>
+		</TestCase>
+		
+		
+		
+		<TestCase testID="subAppWithSubModule_test3" keywords="[SubApplication,SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(ModuleManager)=>subModule(ModuleLoader):load a sub application, which loads module, the module loads a subModule" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+			<RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');"  waitTarget="" waitEvent="SWFLoaded" />
+			<Pause timeout="200"/>
+			<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" />
+			<Pause timeout="100"/>
+		    	<SetProperty target="subAppRef.document.dg" propertyName="selectedIndex"  value="2" />
+		   </setup>
+		    <body>
+		        <Pause timeout="100"/>
+			<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module4.swf')"/>
+		        <Pause timeout="500"/>
+		        
+		        <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.ccm.label1" value="SubModuleWithLabel loaded"/>
+		    	<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/>
+		    </body>
+		</TestCase>
+		
+
+		
+		<TestCase testID="subAppWithSubModule_test4" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(Modulemanager)=>subModule(ModuleManager):load a sub application which loads module created in moduleManager, subModule is loaded by using ModuleLoader" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');"  waitTarget="" waitEvent="SWFLoaded" />
+			<Pause timeout="200"/>
+			<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" />
+			<Pause timeout="100"/>
+		    	<SetProperty target="subAppRef.document.dg" propertyName="selectedIndex"  value="3" />
+		   </setup>
+		    <body>
+		       
+			<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module5.swf')"/>
+			<Pause timeout="1000"/>
+		        <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.vg.getChildAt(0).addNumbers(5,7)"/>
+					        
+			<Pause timeout="300"/>
+			<AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.vg.getChildAt(0).label1" value="12"/>
+
+			<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/>
+		    </body>
+		</TestCase>
+
+		
+		<TestCase testID="subAppWithSubModule_test5" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleLoader):a moduleLoader loads a module, the module has sub application, subapp loads a module by using moduleLoader,loading is done automatically without user interaction" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp3.swf');"  waitTarget="" waitEvent="moduleLoaded" />
+		   </setup>
+		    <body>
+		        <Pause timeout="1000"/>
+		     
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.label1" value="SubModuleWithLabel loaded"/>
+		        
+		        <Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/>
+		    </body>
+		</TestCase>
+
+		<TestCase testID="subAppWithSubModule_test6" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleLoader):a moduleLoader loads a module, the module loads a sub application, the subapp loads module which uses moduleLoader" >
+		    <setup>
+		    	<RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		    	
+		    	<RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp2.swf');"  waitTarget="" waitEvent="moduleLoaded" />
+		
+		   </setup>
+		    <body>
+		        <Pause timeout="600"/>
+		
+		        <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.loadModule('assets/MXTitleWindowModule.swf')"/>
+								        
+			<Pause timeout="400"/>
+			<AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.mxTW.label1" value="MXTitleWindow loaded"/>
+
+			<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/>
+		    </body>
+		</TestCase>
+
+		<TestCase testID="subAppWithSubModule_test7" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleManager):a moduleLoader loads a module through ModuleLoader, the module loads a sub application, the subapp loads module which uses moduleManager" >
+		    <setup>
+		        <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/>
+		    	
+		    	<RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp2.swf');"  waitTarget="" waitEvent="moduleLoaded" />
+		
+		   </setup>
+		    <body>
+		        <Pause timeout="600"/>
+		
+		        <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.loadModule('assets/SimpleASModuleTest.swf')"/>
+			<Pause timeout="400"/>				        
+			<RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.moduleLoader1.child.addNumbers(5,7)"/>
+								        
+			<Pause timeout="200"/>
+			<AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.label1" value="12"/>
+
+			<Pause timeout="100"/>
+		    	<RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/>
+		    </body>
+		</TestCase>
+		
+	</testCases>
+
+</UnitTester>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic1.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic1.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,130 @@
+<?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.
+
+-->
+<!-- basic swf for subModule tests, module is loaded by ModuleLoader -->
+<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"
+	creationComplete="init()"
+	>
+ 
+ <fx:Style source="../../../../Assets/Fonts/myStyles.css" />
+ <fx:Style>
+ 	@namespace mx "library://ns.adobe.com/flex/mx/";
+	@namespace s "library://ns.adobe.com/flex/spark/";
+
+ 		mx|Module,
+ 		mx|DataGrid{
+ 		    fontFamily: MyVeraHalo;
+ 		    fontLookup: embeddedCFF;
+ 		    fontAntiAliasType: normal;
+ 		}
+ 		s|Label,
+ 		s|TitleWindow{
+ 		    fontFamily: MyVeraSpark;
+		    fontLookup: embeddedCFF;
+ 		    fontAntiAliasType: normal;
+ 		}
+ 
+ 		
+</fx:Style>
+	<s:layout> <s:VerticalLayout/> </s:layout>
+	
+	<fx:Script>
+		<![CDATA[
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			import mx.collections.ArrayList;
+			import mx.managers.PopUpManager;
+			PopUpManager;
+			private var moduleErrorMsg:String="";
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				moduleErrorMsg=e.errorText;
+				Alert.show(e.errorText);
+				
+				
+			}
+					
+			private var arr:Array = [ { moduleName: "assets/Module1.swf"},
+				{ moduleName: "assets/Module2.swf"},
+				{ moduleName: "assets/Module3.swf"},
+				{ moduleName: "assets/Module4.swf"},
+				{ moduleName: "assets/SimpleASModuleTest.swf"}
+			];
+
+			private function init():void
+			{
+				dg.dataProvider = new ArrayList(arr);
+				setModuleLoaderListeners();
+
+			}
+			public function setModuleLoaderListeners():void
+			{
+				moduleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				moduleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				moduleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+		    		e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+		    		dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			private function loadModule(ml:ModuleLoader, moduleURL:String):void
+			{
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+
+			private function unloadModule(ml:ModuleLoader):void
+			{	
+				ml.unloadModule();
+				ml.url=null;
+
+			}
+			public function resetModuleLoader():void
+			{
+				
+				setModuleLoaderListeners();
+			}
+		
+			
+			
+		]]>
+	</fx:Script>	
+		
+	<mx:DataGrid id="dg" />
+	<s:Button id="btn1" label="load Module1" click="loadModule(moduleLoader1,dg.selectedItem.moduleName)" />
+	<s:Button id="btn2" label="unload Module1" click="unloadModule(moduleLoader1);" />
+		
+	<mx:ModuleLoader id="moduleLoader1" />
+
+</s:Application>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic2.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic2.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,135 @@
+<?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.
+
+-->
+<!-- basic swf for subModule tests, module is loaded by ModuleLoader -->
+<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"
+	creationComplete="init()"
+	>
+ <fx:Style source="../../../../Assets/Fonts/myStyles.css" />
+  <fx:Style>
+  	@namespace mx "library://ns.adobe.com/flex/mx/";
+	@namespace s "library://ns.adobe.com/flex/spark/";
+
+  		mx|Module,
+  		mx|TitleWindow,
+  		mx|Label,
+  		mx|DataGrid{
+  		    fontFamily: MyVeraHalo;
+  		    fontLookup: embeddedCFF;
+  		    fontAntiAliasType: normal;
+  		}
+  		s|Label,
+  		s|TitleWindow{
+  		    fontFamily: MyVeraSpark;
+ 		    fontLookup: embeddedCFF;
+  		    fontAntiAliasType: normal;
+  		}
+  
+  		
+</fx:Style>
+	<s:layout> <s:VerticalLayout/> </s:layout>
+	
+	<fx:Script>
+		<![CDATA[
+			import mx.events.ModuleEvent;
+			import mx.events.FlexEvent;
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			import mx.collections.ArrayList;
+			import mx.managers.PopUpManager;
+			import mx.modules.IModuleInfo;
+			import mx.modules.ModuleManager;
+			import mx.core.IVisualElement;
+			PopUpManager
+			public var moduleCnt:IVisualElement;;
+			private var moduleErrorMsg:String="";
+			private var info:IModuleInfo;
+			
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				moduleErrorMsg=e.errorText;
+				Alert.show(e.errorText);
+				
+				
+			}
+					
+			private var arr:Array = [ { moduleName: "assets/Module1.swf"},
+							{ moduleName: "assets/Module2.swf"},
+							{ moduleName: "assets/Module3.swf"},
+							{ moduleName: "assets/Module4.swf"},
+							{ moduleName: "assets/SimpleASModuleTest.swf"}
+			];
+	
+	
+
+			private function init():void
+			{
+				dg.dataProvider = new ArrayList(arr);
+			}
+			
+			private function getModuleAndLoad(moduleURL:String):void
+			{
+				info=ModuleManager.getModule(moduleURL);
+				info.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				info.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				info.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+				info.load(new ApplicationDomain(ApplicationDomain.currentDomain), null,null, this.moduleFactory);
+
+
+			}
+			
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+		    		e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+		    		moduleCnt=info.factory.create() as IVisualElement;
+		    		moduleHolder.addElement(moduleCnt);
+		    		dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+				resetModuleHolder();
+				
+			}
+			
+			private function unloadModule():void
+			{	
+				info.release();
+				info.unload();
+			}
+			
+			public function resetModuleHolder():void
+			{
+				moduleHolder.removeAllElements();
+			}
+		]]>
+	</fx:Script>	
+		
+	<mx:DataGrid id="dg" />
+	<s:Button id="btn1" label="load Module1" click="getModuleAndLoad(dg.selectedItem.moduleName)" />
+	<s:Button id="btn2" label="unload Module1" click="unloadModule();" />
+	<s:VGroup id="moduleHolder"/>
+	
+</s:Application>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic3.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/SubModuleTest_basic3.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,149 @@
+<?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.
+
+-->
+<!-- basic swf for subModule tests, load a subapp -->
+<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"
+	creationComplete="resetModuleLoader()"
+	>
+ 
+ <fx:Style source="../../../../Assets/Fonts/myStyles.css" />
+ <fx:Style>
+ 	@namespace mx "library://ns.adobe.com/flex/mx/";
+	@namespace s "library://ns.adobe.com/flex/spark/";
+
+ 		mx|Module,
+ 		mx|DataGrid{
+ 		    fontFamily: MyVeraHalo;
+ 		    fontLookup: embeddedCFF;
+ 		    fontAntiAliasType: normal;
+ 		}
+ 		s|Label,
+ 		s|TitleWindow{
+ 		    fontFamily: MyVeraSpark;
+		    fontLookup: embeddedCFF;
+ 		    fontAntiAliasType: normal;
+ 		}
+ 
+ 		
+</fx:Style>
+	<s:layout> <s:VerticalLayout/> </s:layout>
+	
+	<fx:Script>
+		<![CDATA[
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import flash.events.Event;
+			import mx.controls.Alert;	
+			import mx.collections.ArrayList;
+			import mx.managers.PopUpManager;
+			import mx.managers.SystemManager;
+			import mx.core.IUIComponent;
+			
+			PopUpManager;
+			private var moduleErrorMsg:String="";
+			public var subAppRef:SystemManager;
+			
+			public function handleSWFLoaded(e:Event):void
+			{
+				e.currentTarget.removeEventListener("complete", handleSWFLoaded);
+				dispatchEvent(new FlexEvent("SWFLoaded")); 
+				subAppRef=(contentLoader.content as SystemManager);
+				trace("subAppRef="+subAppRef);
+				
+				
+			}
+			public function handleSWFLoadedError(e:Event):void
+			{
+				e.currentTarget.removeEventListener("error", handleSWFLoaded);
+				dispatchEvent(new FlexEvent("ErrorSWFLoad"));
+				
+			}
+			public function handleSWFUnloaded(e:Event):void
+			{
+				e.currentTarget.removeEventListener("unload", handleSWFUnloaded);
+				dispatchEvent(new FlexEvent("SWFUnloaded"));
+			}
+			public function loadContent(swfURL:String):void
+			{
+				
+				contentLoader.addEventListener("complete",handleSWFLoaded);
+				contentLoader.addEventListener("unload",handleSWFUnloaded);
+				contentLoader.load(swfURL);
+			}
+			public function unloadContent(swfURL:String):void
+			{
+				contentLoader.unloadAndStop(true);
+				
+			}
+		        private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				moduleErrorMsg=e.errorText;
+				Alert.show(e.errorText);
+				
+				
+			}
+			public function setModuleLoaderListeners():void
+			{
+				moduleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				moduleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				moduleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+		    		e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+		    		dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			public function loadModule(moduleURL:String):void
+			{
+				if (moduleLoader1.url==null)
+					moduleLoader1.url = moduleURL;
+				else moduleLoader1.loadModule();
+			}
+
+			public function unloadModule():void
+			{	
+				//moduleLoader1.unloadModule(); 
+				moduleLoader1.unloadModule();
+				moduleLoader1.url=null;
+
+			}
+			public function resetModuleLoader():void
+			{
+				unloadModule();
+				setModuleLoaderListeners();
+			}
+
+		]]>
+	</fx:Script>	
+		
+	<mx:Panel id="myPanel" title="load a sub app">
+	    <mx:SWFLoader id="contentLoader" />     <!--  trustContent="true"  -->
+     	</mx:Panel> 
+	<mx:ModuleLoader id="moduleLoader1" />
+</s:Application>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MXTitleWindowModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MXTitleWindowModule.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MXTitleWindowModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MXTitleWindowModule.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" width="400" height="300"
+		   xmlns:local="*">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<local:MyMXTitleWindow id="mxTW"/>
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module1.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module1.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,82 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+           xmlns:s="library://ns.adobe.com/flex/spark" 
+           xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" width="400" height="300"
+           creationComplete="init()">
+    <fx:Declarations>
+        <!-- Place non-visual elements (e.g., services, value objects) here -->
+    </fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			private var errMsg:String="";
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				errMsg=e.errorText;
+				Alert.show(e.errorText);
+
+
+			}
+			public function loadModule1():void
+			{
+				loadModule(subModuleLoader1, "assets/SimpleModuleWithLabel.swf");
+			}
+			private function loadModule(ml:ModuleLoader, moduleURL:String):void
+			{
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+			private function init():void
+			{
+				subModuleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				subModuleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				subModuleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+		]]>
+	</fx:Script>
+
+    <s:Label text="Module1" />
+    
+    <s:Button id="mdBtn1" label="load SubModule1" click="loadModule(subModuleLoader1,'assets/SimpleModuleWithLabel.swf')" />
+    <s:Button id="mdBtn2" label="unload SubModule1" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+    <mx:ModuleLoader id="subModuleLoader1" />
+    
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module2.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module2.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,86 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" width="400" height="300"
+		   creationComplete="init()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			//use a datagrid to hold all submodules, load/unload is based on selection index
+			//or use tabnavigator
+			import mx.managers.PopUpManager;
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			private var errMsg:String="";
+			PopUpManager;
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				errMsg=e.errorText;
+				Alert.show(e.errorText);
+
+
+			}
+			public function loadModule1():void
+			{
+				loadModule(subModuleLoader1, "assets/TitleWindowModule.swf");
+			}
+			private function loadModule(ml:ModuleLoader, moduleURL:String):void
+			{
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+			private function init():void
+			{
+				subModuleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				subModuleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				subModuleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module2" />
+	
+	<s:Button id="mdBtn1" label="load TitleWindowModule" click="loadModule(subModuleLoader1,'assets/TitleWindowModule.swf')" /><!-- TitleWindowModule.swf -->
+	<s:Button id="mdBtn2"  label="unload TitleWindowModule" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+	<mx:ModuleLoader id="subModuleLoader1" />
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module3.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module3.mxml Mon Aug  6 20:21:26 2012
@@ -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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" width="400" height="300"
+		   creationComplete="init()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			//use a datagrid to hold all submodules, load/unload is based on selection index
+			//or use tabnavigator
+			import mx.managers.PopUpManager;
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			private var errMsg:String="";
+			PopUpManager;
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				errMsg=e.errorText;
+				Alert.show(e.errorText);
+
+
+			}
+			public function loadModule1():void
+			{
+				loadModule(subModuleLoader1, "assets/TitleWindowModule.swf");
+			}
+			private function loadModule(ml:ModuleLoader, moduleURL:String):void
+			{
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+			private function init():void
+			{
+				subModuleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				subModuleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				subModuleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module3" />
+	
+	<s:Button id="mdBtn1" label="load TitleWindowModule" click="loadModule(subModuleLoader1,'assets/MXTitleWindowModule.swf')" /><!-- MXTitleWindowModule.swf -->
+	<s:Button id="mdBtn2"  label="unload TitleWindowModule" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+	<mx:ModuleLoader id="subModuleLoader1" />
+
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module4.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module4.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module4.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module4.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,76 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" 
+		   layout="vertical" width="400" height="300"
+		   creationComplete="initApp()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			import mx.core.IVisualElement;
+			import mx.events.ModuleEvent;
+			import mx.events.FlexEvent;
+			import mx.modules.IModuleInfo;
+			import mx.modules.ModuleManager;
+			import mx.controls.Alert;
+			
+			private var moduleErrorMsg:String;
+			
+			public var info:IModuleInfo;
+			
+			public var ccm:IVisualElement;
+			private function initApp():void {
+				info = ModuleManager.getModule("assets/SimpleModuleWithLabel.swf");
+				info.addEventListener(ModuleEvent.READY, modEventHandler); 
+				info.addEventListener(ModuleEvent.ERROR, modErrEventHandler);
+				info.addEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				info.load(new ApplicationDomain(ApplicationDomain.currentDomain), null,null, this.moduleFactory);
+			}
+			
+					
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+			
+			private function modEventHandler(e:ModuleEvent):void {
+			        e.currentTarget.removeEventListener(ModuleEvent.READY,modEventHandler);
+				ccm=info.factory.create() as IVisualElement;
+				vg.addElement(ccm);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			private function modErrEventHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,modErrEventHandler);
+				moduleErrorMsg=e.errorText;
+				Alert.show(e.errorText);
+			}
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module4" />
+	<s:VGroup id="vg" />
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module5.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module5.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module5.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module5.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,76 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" 
+		   layout="vertical" width="400" height="300"
+		   creationComplete="initApp()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			import mx.core.IVisualElement;
+			import mx.events.ModuleEvent;
+			import mx.events.FlexEvent;
+			import mx.modules.IModuleInfo;
+			import mx.modules.ModuleManager;
+			import mx.controls.Alert;
+			
+			private var moduleErrorMsg:String;
+			
+			public var info:IModuleInfo;
+			
+			public var ccm:IVisualElement;
+			private function initApp():void {
+				info = ModuleManager.getModule("assets/SimpleASModuleTest.swf");
+				info.addEventListener(ModuleEvent.READY, modEventHandler); 
+				info.addEventListener(ModuleEvent.ERROR, modErrEventHandler);
+				info.addEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				info.load(new ApplicationDomain(ApplicationDomain.currentDomain), null,null, this.moduleFactory);
+			}
+			
+					
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+			
+			private function modEventHandler(e:ModuleEvent):void {
+			        e.currentTarget.removeEventListener(ModuleEvent.READY,modEventHandler);
+				ccm=info.factory.create() as IVisualElement;
+				vg.addElement(ccm);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			private function modErrEventHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,modErrEventHandler);
+				moduleErrorMsg=e.errorText;
+				Alert.show(e.errorText);
+			}
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module5" />
+	<s:VGroup id="vg" />
+	
+</mx:Module>

Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module6.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module6.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module6.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/Module6.mxml Mon Aug  6 20:21:26 2012
@@ -0,0 +1,86 @@
+<?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.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" width="400" height="300"
+		   creationComplete="init()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			//use a datagrid to hold all submodules, load/unload is based on selection index
+			//or use tabnavigator
+			import mx.managers.PopUpManager;
+			import mx.events.ModuleEvent;	
+			import mx.events.FlexEvent;	
+			import mx.controls.Alert;	
+			import mx.events.ModuleEvent;
+			import mx.modules.Module;
+			private var errMsg:String="";
+			PopUpManager;
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				errMsg=e.errorText;
+				Alert.show(e.errorText);
+
+
+			}
+			public function loadModule1():void
+			{
+				loadModule(subModuleLoader1, "assets/SimpleASModuleTest.swf");
+			}
+			private function loadModule(ml:ModuleLoader, moduleURL:String):void
+			{
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+			private function init():void
+			{
+				subModuleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				subModuleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				subModuleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+
+
+			}
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.READY, handleModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleLoaded"));
+			}
+			public function removeModuleLoaded(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+				dispatchEvent(new FlexEvent("moduleRemoved"));
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module2" />
+	
+	<s:Button id="mdBtn1" label="load SimpleASModuleTest" click="loadModule(subModuleLoader1,'assets/SimpleASModuleTest.swf')" /><!-- TitleWindowModule.swf -->
+	<s:Button id="mdBtn2"  label="unload SimpleASModuleTest" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+	<mx:ModuleLoader id="subModuleLoader1" />
+	
+</mx:Module>



Mime
View raw message