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:21:29 UTC
svn commit: r1369975 [5/5] - in
/incubator/flex/trunk/mustella/tests/Modules: ./ Constraints/
Constraints/Properties/ Constraints/SWFs/ Constraints/SWFs/comps/ Fonts/
Fonts/SWFs/ Fonts/SWFs/assets/ Fonts/tests/ Fonts/tests/baselines/ RSLs/
RSLs/Integra...
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp2.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ layout="vertical" width="400" height="300"
+ creationComplete="init()">
+ <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>
+
+</mx:Module>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/ModuleLoadSubApp3.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" width="400" height="300"
+ creationComplete="init()">
+ <fx:Declarations>
+ <!-- Place non-visual elements (e.g., services, value objects) here -->
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+ import mx.events.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>
+</mx:Module>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MyMXTitleWindow.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MyMXTitleWindow.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MyMXTitleWindow.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/MyMXTitleWindow.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,43 @@
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
+ layout="absolute"
+ showCloseButton="true"
+ title="TitleWindow"
+ width="300"
+ height="200">
+
+ <mx:Script>
+ <![CDATA[
+ import mx.core.IFlexDisplayObject;
+ import mx.events.CloseEvent;
+ import mx.managers.PopUpManager;
+
+ ]]>
+ </mx:Script>
+ <mx:Label id="label1" text="MXTitleWindow loaded" />
+ <mx:Form id="myForm" height="200">
+ <mx:FormItem id="frmitem" label="From :">
+ <mx:TextInput id="ti1"/>
+ </mx:FormItem>
+ <mx:FormItem label="To :">
+ <mx:TextInput/>
+ </mx:FormItem>
+ <mx:FormItem label="Subject :">
+ <mx:TextInput/>
+ </mx:FormItem>
+ <mx:FormItem label="Body :">
+ <mx:TextArea width="100%" height="50" maxChars="120"/>
+ </mx:FormItem>
+ <mx:FormItem direction="horizontal">
+ <mx:Button label="Send" />
+ <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);" />
+ </mx:FormItem>
+ </mx:Form>
+
+
+ <mx:ControlBar>
+ <mx:CheckBox id="chk1" selected="true" label="toggle moveable" />
+ <mx:CheckBox id="chk2" selected="true" label="toggle closeButton" />
+
+ </mx:ControlBar>
+
+</mx:TitleWindow>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleASModuleTest.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleASModuleTest.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleASModuleTest.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleASModuleTest.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ layout="vertical" width="400" height="300"
+ creationComplete="initApp()">
+ <fx: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)"/>
+</mx:Module>
\ No newline at end of file
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModule.as
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModule.as?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModule.as (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModule.as Mon Aug 6 20:21:26 2012
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleModuleWithLabel.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" >
+ <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" />
+
+</mx:Module>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleTitleWindow.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleTitleWindow.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleTitleWindow.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SimpleTitleWindow.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,9 @@
+<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
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp1.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp1.mxml Mon Aug 6 20:21:26 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/";
+
+ mx|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();" />
+
+ <mx:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp2.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp2.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!-- basic swf for subModule tests, module is loaded by ModuleLoader -->
+<s:Application
+ xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ 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/";
+
+ mx|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();" />
+
+ <mx:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp3.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp3.mxml Mon Aug 6 20:21:26 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/";
+
+ mx|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>
+
+ <mx:ModuleLoader id="moduleLoader1" />
+ <s:Button id="mbtn1" label="load module" click='loadModule("assets/SimpleModuleWithLabel.swf");'/>
+
+</s:Application>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp4.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp4.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp4.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/SubApp4.mxml Mon Aug 6 20:21:26 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/";
+
+ mx|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" />
+ <mx:ModuleLoader id="moduleLoader1" />
+
+</s:Application>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/TitleWindowModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/TitleWindowModule.mxml?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/TitleWindowModule.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/assets/TitleWindowModule.mxml Mon Aug 6 20:21:26 2012
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ layout="absolute" width="400" height="300" creationComplete="addPopUp()" >
+ <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
+ {
+
+ 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>
+
+</mx:Module>
Added: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/pre_compile.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/pre_compile.sh?rev=1369975&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/pre_compile.sh (added)
+++ incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/pre_compile.sh Mon Aug 6 20:21:26 2012
@@ -0,0 +1,57 @@
+#!/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"`
+
+$SDK_DIR/bin/mxmlc -link-report=subMTLinkReport3.xml SubModuleTest_basic3.mxml
+
+
+cd assets
+
+echo "Removing previously compiled files..."
+rm -f `find . -name "*.swf"`
+
+echo "Compiling components..."
+
+$SDK_DIR/bin/mxmlc -static-rsls=true SimpleTitleWindow.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true MyMXTitleWindow.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true SimpleModule.as
+$SDK_DIR/bin/mxmlc -static-rsls=true SubApp1.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true SubApp2.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true SubApp3.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true SubApp4.mxml
+
+echo "Compiling module SWFs..."
+$SDK_DIR/bin/mxmlc -static-rsls=true SimpleModuleWithLabel.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true SimpleASModuleTest.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true TitleWindowModule.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true MXTitleWindowModule.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true ModuleLoadSubApp2.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true ModuleLoadSubApp3.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module1.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module2.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module3.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module4.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module5.mxml
+$SDK_DIR/bin/mxmlc -static-rsls=true Module6.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../subMTLinkReport3.xml -static-rsls=true ModuleLoadSubApp2.mxml
+$SDK_DIR/bin/mxmlc -load-externs=../subMTLinkReport3.xml -static-rsls=true ModuleLoadSubApp3.mxml
+
+
+
Propchange: incubator/flex/trunk/mustella/tests/Modules/SubModules/SWFs/pre_compile.sh
------------------------------------------------------------------------------
svn:executable = *