You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2012/08/06 22:41:58 UTC
svn commit: r1369996 [3/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...
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleASModuleTest.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleASModuleTest.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleASModuleTest.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleASModuleTest.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,131 @@
+<?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()">
+
+ <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 assetModule:IModuleInfo;
+
+ public var sm:Object;
+
+
+
+ [Bindable]
+
+ public var answer:String ="0";
+
+
+
+ public function initApp():void {
+
+ // Get the IModuleInfo interface for the specified URL.
+
+ assetModule = ModuleManager.getModule("assets/SimpleModule.swf");
+
+ assetModule.addEventListener(ModuleEvent.READY, getModuleInstance);
+
+ assetModule.addEventListener(ModuleEvent.ERROR, modErrEventHandler);
+
+ assetModule.addEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+
+ assetModule.load(new ApplicationDomain(ApplicationDomain.currentDomain), null,null, this.moduleFactory);
+
+ }
+
+
+
+ public function getModuleInstance(e:Event):void {
+
+ // Get an instance of the module.
+
+ sm = assetModule.factory.create();
+
+ trace("getModuleInstance:sm="+sm);
+
+ dispatchEvent(new FlexEvent("moduleLoaded"));
+
+ }
+
+ public function removeModuleLoaded(e:ModuleEvent):void
+
+ {
+
+ e.currentTarget.removeEventListener(ModuleEvent.UNLOAD, removeModuleLoaded);
+
+ dispatchEvent(new FlexEvent("moduleRemoved"));
+
+
+
+ }
+
+ private function modErrEventHandler(e:ModuleEvent):void
+
+ {
+
+ e.currentTarget.removeEventListener(ModuleEvent.ERROR,modErrEventHandler);
+
+ moduleErrorMsg=e.errorText;
+
+ Alert.show(e.errorText);
+
+ }
+
+ public function addNumbers(n:Number, m:Number):void {
+
+ answer =sm.computeAnswer(n,m).toString();
+
+ }
+
+ ]]>
+
+ </fx:Script>
+
+ <s:Label id="label1" width="100" text="{answer}"/>
+
+ <s:Button id="b1" label="Compute" click="addNumbers(5,7)"/>
+
+</s:Module>
\ No newline at end of file
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleASModuleTest.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModule.as
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModule.as?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModule.as (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModule.as Mon Aug 6 20:41:55 2012
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+// Simple ActionScript Module.as
+
+package {
+
+ import mx.modules.ModuleBase;
+
+
+
+ public class SimpleModule extends ModuleBase {
+
+ public function SimpleModule() {
+
+ trace("SimpleModule created");
+
+ }
+
+
+
+ public function computeAnswer(a:Number, b:Number):Number {
+
+ return a + b;
+
+ }
+
+ }
+
+}
\ No newline at end of file
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModule.as
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,41 @@
+<?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" >
+ <s:layout><s:VerticalLayout/></s:layout>
+ <fx:Declarations>
+
+ <!-- Place non-visual elements (e.g., services, value objects) here -->
+
+ </fx:Declarations>
+
+
+
+ <s:Label id="label1" text="SubModuleWithLabel loaded" />
+
+ <s:TextInput id="ti" />
+
+
+
+</s:Module>
+
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleTitleWindow.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleTitleWindow.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleTitleWindow.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleTitleWindow.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,17 @@
+<s:TitleWindow
+
+ xmlns:fx="http://ns.adobe.com/mxml/2009"
+
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+
+ xmlns:s="library://ns.adobe.com/flex/spark"
+
+ width="400" height="300" >
+
+
+
+<s:Label id="label1" text="SimpleTitleWindow loaded" />
+
+<s:CheckBox id="chk" label="test" selected="true" y="50" />
+
+</s:TitleWindow>
\ No newline at end of file
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SimpleTitleWindow.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp1.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp1.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,131 @@
+<?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"
+ backgroundColor="0xffffff" 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|Button,
+ 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/Module6.swf"},
+ { moduleName: "assets/Module4.swf"},
+ { moduleName: "assets/Module5.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"));
+ }
+ 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
+ {
+
+ setModuleLoaderListeners();
+ }
+
+
+
+ ]]>
+ </fx:Script>
+
+ <mx:DataGrid id="dg" />
+ <s:Button id="btn1" label="load Module1" click="loadModule(dg.selectedItem.moduleName)" />
+ <s:Button id="btn2" label="unload Module1" click="unloadModule();" />
+
+ <s:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp1.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp2.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp2.mxml Mon Aug 6 20:41:55 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"
+ backgroundColor="0xffffff" 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|Button,
+ 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/MXTitleWindowModule.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"));
+ }
+ 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
+ {
+
+ setModuleLoaderListeners();
+ }
+
+
+
+ ]]>
+ </fx:Script>
+
+ <mx:DataGrid id="dg" />
+ <s:Button id="btn1" label="load Module1" click="loadModule(dg.selectedItem.moduleName)" />
+ <s:Button id="btn2" label="unload Module1" click="unloadModule();" />
+
+ <s:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp2.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp3.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp3.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,124 @@
+<?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|Button,
+ 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;
+
+ private var moduleErrorMsg:String="";
+ private function errorModuleHandler(e:ModuleEvent):void
+ {
+ e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+ moduleErrorMsg=e.errorText;
+ Alert.show(e.errorText);
+
+
+
+ }
+
+
+ private function init():void
+ {
+ setModuleLoaderListeners();
+ trace("###inside SubApp3.mxml");
+ loadModule("assets/SimpleModuleWithLabel.swf");
+
+
+ }
+ 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
+ {
+
+ setModuleLoaderListeners();
+ }
+
+
+
+ ]]>
+ </fx:Script>
+
+ <s:ModuleLoader id="moduleLoader1" />
+ <s:Button id="mbtn1" label="load module" click='loadModule("assets/SimpleModuleWithLabel.swf");'/>
+
+</s:Application>
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp3.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp4.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp4.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp4.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp4.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,122 @@
+<?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"
+ backgroundColor="0xffffff" 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|Button,
+ 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;
+
+ private var moduleErrorMsg:String="";
+ private function errorModuleHandler(e:ModuleEvent):void
+ {
+ e.currentTarget.removeEventListener(ModuleEvent.ERROR,errorModuleHandler);
+ moduleErrorMsg=e.errorText;
+ Alert.show(e.errorText);
+
+
+ }
+
+
+
+ private function init():void
+ {
+ setModuleLoaderListeners();
+ loadModule("assets/SimpleASModuleTest.swf")
+
+ }
+ 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
+ {
+
+ setModuleLoaderListeners();
+ }
+
+
+
+ ]]>
+ </fx:Script>
+
+ <s:Label text="From SubApp4" />
+ <s:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/SubApp4.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/TitleWindowModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/TitleWindowModule.mxml?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/TitleWindowModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/TitleWindowModule.mxml Mon Aug 6 20:41:55 2012
@@ -0,0 +1,101 @@
+<?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="addPopUp()" >
+ <s:layout><s:VerticalLayout/></s:layout>
+ <fx:Declarations>
+
+ <!-- Place non-visual elements (e.g., services, value objects) here -->
+
+ </fx:Declarations>
+
+ <fx:Script>
+
+ <![CDATA[
+
+ public var tw:SimpleTitleWindow;
+
+ import mx.core.IFlexDisplayObject;
+
+ import mx.managers.PopUpManager;
+
+ import mx.events.FlexEvent;
+
+ private function addPopUp():void
+
+ {
+
+
+ trace("*****************TITLEWINDOW********************");
+ tw = new SimpleTitleWindow();
+
+ tw.title="Simple TitleWindow";
+
+ tw.width = 250;
+
+ tw.x=30;
+
+ tw.y=50;
+
+ PopUpManager.addPopUp(tw,this,false);
+
+ tw.addEventListener("creationComplete", handleTWCreationComplete);
+
+ tw.addEventListener("close", closeHandler);
+
+
+
+ }
+
+ public function handleTWCreationComplete(e:FlexEvent):void
+
+ {
+
+
+
+ e.currentTarget.removeEventListener("creationComplete", handleTWCreationComplete);
+
+ SimpleTitleWindow(e.currentTarget).closeButton.enabled=true;
+
+ }
+
+ private function closeHandler(event:Event):void
+
+ {
+
+ event.target.removeEventListener("close", closeHandler);
+
+ PopUpManager.removePopUp(event.target as IFlexDisplayObject);
+
+ }
+
+ ]]>
+
+ </fx:Script>
+
+
+
+</s:Module>
+
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/assets/TitleWindowModule.mxml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/pre_compile.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/pre_compile.sh?rev=1369996&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/pre_compile.sh (added)
+++ incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/pre_compile.sh Mon Aug 6 20:41:55 2012
@@ -0,0 +1,52 @@
+#!/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 "subMTLinkReport*.xml"`
+echo "***************************************"
+echo ""
+echo ""
+echo ""
+echo $SDK_DIR/bin
+echo ""
+echo ""
+echo ""
+echo "***************************************"
+$SDK_DIR/bin/mxmlc SubModuleTest_basic3.mxml -link-report=subMTLinkReport3.xml
+cd assets
+echo "Removing previously compiled files..."
+rm -f `find . -name "*.swf"`
+echo "Compiling components..."
+$SDK_DIR/bin/mxmlc SimpleTitleWindow.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc SimpleModule.as -static-rsls=true
+$SDK_DIR/bin/mxmlc SubApp1.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc SubApp2.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc SubApp3.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc SubApp4.mxml -static-rsls=true
+echo "Compiling module SWFs..."
+$SDK_DIR/bin/mxmlc SimpleModuleWithLabel.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc SimpleASModuleTest.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc TitleWindowModule.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module1.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module2.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module3.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module4.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module5.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc Module6.mxml -static-rsls=true
+$SDK_DIR/bin/mxmlc ModuleLoadSubApp2.mxml -load-externs=../subMTLinkReport3.xml
+$SDK_DIR/bin/mxmlc ModuleLoadSubApp3.mxml -load-externs=../subMTLinkReport3.xml
\ No newline at end of file
Propchange: incubator/flex/trunk/mustella/tests/SparkModules/SubModules/SWFs/pre_compile.sh
------------------------------------------------------------------------------
svn:executable = *