incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1369996 [2/3] - in /incubator/flex/trunk/mustella/tests/SparkModules: ./ Constraints/ Constraints/Properties/ Constraints/Properties/baselines/ Constraints/SWFs/ Constraints/SWFs/assets/ Events/ Events/SWFs/ Events/SWFs/assets/ Events/test...
Date Mon, 06 Aug 2012 20:41:58 GMT
Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/AnotherDataGridModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/AnotherDataGridModule.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/AnotherDataGridModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/AnotherDataGridModule.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,68 @@
+<?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:Module width="800" height="600"
+	xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		  xmlns:s="library://ns.adobe.com/flex/spark" 
+		  xmlns:mx="library://ns.adobe.com/flex/mx">
+	
+	<fx:Script>
+        <![CDATA[
+            import mx.collections.ArrayCollection;
+                  
+            [Bindable]
+            private var dpFlat:ArrayCollection = new ArrayCollection([
+              {Region:"Southwest", Territory:"Arizona", 
+                  Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, 
+              {Region:"Southwest", Territory:"Arizona", 
+                  Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000},  
+              {Region:"Southwest", Territory:"Central California", 
+                  Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000},  
+              {Region:"Southwest", Territory:"Nevada", 
+                  Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000},  
+              {Region:"Southwest", Territory:"Northern California", 
+                  Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, 
+              {Region:"Southwest", Territory:"Northern California", 
+                  Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000},  
+              {Region:"Southwest", Territory:"Southern California", 
+                  Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, 
+              {Region:"Southwest", Territory:"Southern California", 
+                  Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}
+            ]);
+        ]]>
+    </fx: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>
+</s:Module>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/AnotherDataGridModule.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule-config.xml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule-config.xml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule-config.xml Mon Aug  6 20:41:55 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>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>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule-config.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,57 @@
+<?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:Module width="300" height="300"
+xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		  xmlns:s="library://ns.adobe.com/flex/spark" 
+		  xmlns:mx="library://ns.adobe.com/flex/mx">
+	<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|ComboBox{
+			fontFamily: MyVeraHalo;
+			fontLookup: embeddedCFF;
+			fontAntiAliasType: normal;
+		}
+		
+	</fx:Style>	
+	<fx:Script>
+        <![CDATA[          
+        import mx.collections.ArrayCollection;
+
+        [Bindable]
+        private var medalsAC:ArrayCollection = new ArrayCollection( [
+            { Country: "USA" },
+            { Country: "China" },
+            { Country: "Russia"  } ]);
+    
+        ]]>
+    </fx:Script>
+	
+	<mx:ComboBox id="chart" 
+        height="100%" 
+        width="100%"
+        paddingRight="5" 
+        paddingLeft="5" 
+        labelField = "Country"
+        dataProvider="{medalsAC}"/>          
+	
+</s:Module>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/ComboModule.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule-config.xml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule-config.xml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule-config.xml Mon Aug  6 20:41:55 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>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>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule-config.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,108 @@
+<?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:Module width="640" height="480"
+	xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		  xmlns:s="library://ns.adobe.com/flex/spark" 
+		  xmlns:mx="library://ns.adobe.com/flex/mx">
+	
+<fx:Declarations>
+	<fx:XMLList id="employees">
+			<employee>
+				
+				<name>Christina Coenraets</name>
+				
+				<phone>555-219-2270</phone>
+				
+				<email>ccoenraets@fictitious.com</email>
+				
+				<active>true</active>
+				
+			</employee>
+			
+			<employee>
+				
+				<name>Joanne Wall</name>
+				
+				<phone>555-219-2012</phone>
+				
+				<email>jwall@fictitious.com</email>
+				
+				<active>true</active>
+				
+			</employee>
+			
+			<employee>
+				
+				<name>Maurice Smith</name>
+				
+				<phone>555-219-2012</phone>
+				
+				<email>maurice@fictitious.com</email>
+				
+				<active>false</active>
+				
+			</employee>
+			
+			<employee>
+				
+				<name>Mary Jones</name>
+				
+				<phone>555-219-2000</phone>
+				
+				<email>mjones@fictitious.com</email>
+				
+				<active>true</active>
+				
+			</employee>
+			
+
+	</fx:XMLList>
+</fx:Declarations>
+
+    <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}" selectedIndex="0" selectable="true">
+            <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>
+
+	
+</s:Module>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/assets/DataGridModule.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/pre_compile.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/pre_compile.sh?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/pre_compile.sh (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/RSLs/SWFs/pre_compile.sh Mon Aug  6 20:41:55 2012
@@ -0,0 +1,37 @@
+#!/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.
+##
+################################################################################
+echo "***************************************"
+echo ""
+echo ""
+echo ""
+echo $SDK_DIR/bin
+echo ""
+echo ""
+echo ""
+echo "***************************************"
+rm -f `find . -name "lnkReport.*"`
+$SDK_DIR/bin/mxmlc -link-report=lnkReport.xml 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  -static-rsls=true AnotherDataGridModule.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../lnkReport.xml  -static-rsls=true DataGridModule.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../lnkReport.xml  -static-rsls=true ComboModule.mxml

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

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester001.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester001.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester001.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester001.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,229 @@
+<?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="SparkModules/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"/>
+				<RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.loadModule1()" />
+			    <!--<DispatchMouseClickEvent target="moduleLoader1.child.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleLoader1.child" />-->
+				<Pause timeout="1000"/>
+		        <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subModuleLoader1.child.tw.label1" value="SimpleTitleWindow 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" />
+
+		        <Pause timeout="1000"/>
+
+		        <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"  />
+
+		        <Pause timeout="1000"/>
+
+		        <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/SparkModules/SubModules/Integration/subModules_tester002.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester002.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester002.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester002.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,186 @@
+<?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="SparkModules/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;
+		import mx.utils.ObjectUtil;
+		public static function init(o:DisplayObject):void
+		{
+		}
+		
+		public function traceIt(o:Object):void
+		{
+			var str:String = mx.utils.ObjectUtil.toString(o);
+			trace('string: ' + str);
+		}
+		]]>
+	</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, SparkModule]" 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=""  />
+				<Pause timeout="500"/>
+				<DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" />
+				<Pause timeout="500"/>
+				<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="" />
+				<RunCode code="FlexGlobals.topLevelApplication.moduleCnt.loadModule1()" />
+				<!--<DispatchMouseClickEvent target="moduleCnt.mdBtn1" />-->
+				
+				<Pause timeout="2000"/>
+				
+				<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="" />
+				<Pause timeout="500"/>
+				<RunCode code="FlexGlobals.topLevelApplication.moduleCnt.loadModule1()" />
+				<!--<DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" />-->
+				<Pause timeout="500"/>
+				<AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.tw.label1" value="SimpleTitleWindow 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" />
+				<Pause timeout="500"/>
+				<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/SparkModules/SubModules/Integration/subModules_tester003.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester003.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester003.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/Integration/subModules_tester003.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,383 @@
+<?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="SparkModules/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/TitleWindowModule.swf')"/>
+
+								        
+
+			<Pause timeout="400"/>
+
+			<AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.tw.label1" value="SimpleTitleWindow 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/SparkModules/SubModules/SWFs/SubModuleTest_basic1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic1.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic1.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,129 @@
+<?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";
+
+ 		s|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 spark.modules.Module;
+			import spark.modules.ModuleLoader;
+			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);" />
+		
+	<s:ModuleLoader id="moduleLoader1" />
+
+</s:Application>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic1.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic2.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic2.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,142 @@
+<?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";
+
+  		s|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.utils.ObjectUtil;
+			import mx.events.ModuleEvent;
+			//import mx.modules.Module;
+			//import spark.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"));
+					trace("*************************handleModuleLoaded*************************");
+					trace(" : " + ObjectUtil.toString(moduleHolder.numChildren) + " : ");
+					trace("*************************handleModuleLoaded*************************");
+			}
+			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>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic2.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic3.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic3.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,150 @@
+<?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";
+
+ 		s|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> 
+	<s:ModuleLoader id="moduleLoader1" />
+</s:Application>

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/SubModuleTest_basic3.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module1.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module1.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,97 @@
+<?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: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" width="400" height="300"
+		  creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<fx:Script>
+		<![CDATA[
+			import mx.controls.Alert;
+			import mx.events.FlexEvent;
+			import mx.events.ModuleEvent;
+			
+			private var errMsg:String="";
+			
+			private function errorModuleHandler(e:ModuleEvent):void
+			{
+				e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				errMsg=e.errorText;
+			}
+			
+			public function loadModule1():void
+			{
+				trace("**************************************************");
+				trace(" : LOAD MODULE : loadModule1() ");
+				trace("**************************************************");
+				loadModule(subModuleLoader1, "assets/SimpleModuleWithLabel.swf");
+			}
+			
+			private function loadModule(ml:spark.modules.ModuleLoader, moduleURL:String):void
+			{
+				this.lbl00.text="loading  module...";
+				trace(' ************************************************** loading  module...');
+				if (ml.url==null)
+					ml.url = moduleURL;
+				else ml.loadModule();
+			}
+			
+			private function init():void
+			{
+				trace(' initializing subModuleLoader1 ...');
+				lbl00.text ' initializing subModuleLoader1 ...';
+				trace("*************************INIT*************************");
+				trace(" : " + info.url + " : ");
+				
+				trace("*************************INIT*************************");
+				subModuleLoader1.addEventListener(ModuleEvent.READY,handleModuleLoaded);
+				subModuleLoader1.addEventListener(ModuleEvent.ERROR,errorModuleHandler);
+				subModuleLoader1.addEventListener(ModuleEvent.UNLOAD,removeModuleLoaded);
+			}
+			
+			public function handleModuleLoaded(e:ModuleEvent):void
+			{
+				trace('*****TESTTESTTEST***** moduleLoaded *****TESTTESTTEST*****');
+				lbl00.text="ready? ";
+				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 runmdBtn1():void
+			{
+				trace('*****TESTTESTTEST***** runmdBtn1 *****TESTTESTTEST*****');
+				loadModule1()
+			}
+		]]>
+	</fx:Script>
+	
+	<s:Label text="Module1" id="lbl00" />
+	<s:Button id="mdBtn1" label="load SubModule1 Bill Sahlas" click="loadModule1()" />
+	
+	<s:Button id="mdBtn2" label="unload SubModule1" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+	<s:ModuleLoader id="subModuleLoader1" /> 
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module1.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module2.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module2.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,154 @@
+<?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: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" width="400" height="300"
+
+		   creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<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
+
+			{
+				trace("*****************loadModule1********************");
+				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="loadModule1();trace('******************WTF****************');" /><!-- TitleWindowModule.swf -->
+
+	<s:Button id="mdBtn2"  label="unload TitleWindowModule" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+
+	<s:ModuleLoader id="subModuleLoader1" />
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module2.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module3.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module3.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,156 @@
+<?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: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" width="400" height="300"
+
+		   creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<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/TitleWindowModule.swf')" /><!-- MXTitleWindowModule.swf -->
+
+	<s:Button id="mdBtn2"  label="unload TitleWindowModule" click="{subModuleLoader1.unloadModule(); subModuleLoader1.url=null;}" />
+
+	<s:ModuleLoader id="subModuleLoader1" />
+
+
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module3.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module4.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module4.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module4.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module4.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,134 @@
+<?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: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" 
+
+		   width="400" height="300"
+
+		   creationComplete="initApp()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<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" />
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module4.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module5.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module5.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module5.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module5.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,134 @@
+<?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: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" 
+
+		   width="400" height="300"
+
+		   creationComplete="initApp()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<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" />
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module5.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module6.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module6.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module6.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module6.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,154 @@
+<?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: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" width="400" height="300"
+
+		   creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<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;}" />
+
+	<s:ModuleLoader id="subModuleLoader1" />
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/Module6.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,134 @@
+<?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: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" 
+
+		    width="400" height="300"
+
+		   creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+	<fx:Declarations>
+
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+
+	</fx:Declarations>
+
+	<fx:Script>
+
+		<![CDATA[
+
+			import mx.events.FlexEvent;
+
+			import flash.events.Event;
+
+			import mx.core.IUIComponent;
+
+			import mx.controls.Alert;
+
+			import mx.managers.SystemManager;
+
+
+
+			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("###swf loaded");
+
+			}
+
+			public function handleSWFLoadedError(e:Event):void
+
+			{
+
+
+
+				dispatchEvent(new FlexEvent("ErrorSWFLoad"));
+
+				trace(e);
+
+				Alert.show(e.toString());
+
+
+
+
+
+			}
+
+			public function handleSWFUnloaded(e:Event):void
+
+			{
+
+				e.currentTarget.removeEventListener("unload", handleSWFUnloaded);
+
+				dispatchEvent(new FlexEvent("SWFUnloaded"));
+
+			}
+
+			public function init():void
+
+			{
+
+				contentLoader.addEventListener("complete",handleSWFLoaded);
+
+				contentLoader.addEventListener("unload",handleSWFUnloaded);
+
+				contentLoader.addEventListener("ioError",handleSWFLoadedError);
+
+				contentLoader.addEventListener("securityError",handleSWFLoadedError);
+
+				contentLoader.load("assets/SubApp2.swf");
+
+			}
+
+		]]>
+
+	</fx:Script>
+
+	
+
+	<s:Label text="Module4" />
+
+	<mx:Panel id="myPanel" title="SubApp2 Loaded by module">
+
+	          <mx:SWFLoader id="contentLoader" />     
+
+	     	
+
+	     	<s:Button id="btn1" label="load content" click="contentLoader.load('assets/SubApp2.swf');"/>
+
+        </mx:Panel> 
+
+	
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml Mon Aug  6 20:41:55 2012
@@ -0,0 +1,132 @@
+<?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: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"  width="400" height="300"
+
+           creationComplete="init()">
+	<s:layout><s:VerticalLayout/></s:layout>
+    <fx:Declarations>
+
+        <!-- Place non-visual elements (e.g., services, value objects) here -->
+
+    </fx:Declarations>
+
+	<fx:Script>
+
+		<![CDATA[
+
+			
+
+			import mx.events.FlexEvent;
+
+			import flash.events.Event;
+
+			import mx.core.IUIComponent;
+
+			import mx.controls.Alert;
+
+			import mx.managers.SystemManager;
+
+			
+
+			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("###swf loaded");
+
+			}
+
+			public function handleSWFLoadedError(e:Event):void
+
+			{
+
+				
+
+				dispatchEvent(new FlexEvent("ErrorSWFLoad"));
+
+				trace(e);
+
+				Alert.show(e.toString());
+
+				
+
+
+
+			}
+
+			public function handleSWFUnloaded(e:Event):void
+
+			{
+
+				e.currentTarget.removeEventListener("unload", handleSWFUnloaded);
+
+				dispatchEvent(new FlexEvent("SWFUnloaded"));
+
+			}
+
+			public function init():void
+
+			{
+
+				contentLoader.addEventListener("complete",handleSWFLoaded);
+
+				contentLoader.addEventListener("unload",handleSWFUnloaded);
+
+				contentLoader.addEventListener("ioError",handleSWFLoadedError);
+
+				contentLoader.addEventListener("securityError",handleSWFLoadedError);
+
+				contentLoader.load("assets/SubApp3.swf");
+
+			}
+
+			
+
+		]]>
+
+	</fx:Script>
+
+	
+
+	<mx:Panel id="myPanel" title="SubApp3 Loaded by module">
+
+          <mx:SWFLoader id="contentLoader" />     
+
+     	
+
+     	<s:Button id="btn1" label="load content" click="contentLoader.load('assets/SubApp3.swf');"/>
+
+        </mx:Panel> 
+
+</s:Module>
+

Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message