<?xml version="1.0" encoding="utf-8"?>
<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"
minWidth="955" minHeight="600"
creationComplete="onStart()"
xmlns:spicefactory="http://www.spicefactory.org/parsley"
xmlns:cairngorm="com.adobe.cairngorm.*" xmlns:module="com.adobe.cairngorm.module.*">
<fx:Declarations>
<spicefactory:ContextBuilder>
<cairngorm:CairngormModuleSupport/>
<spicefactory:FlexConfig type="{ TestModuleContext }"/>
</spicefactory:ContextBuilder>
<spicefactory:Configure/>
</fx:Declarations>
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
.labelStyle
{
color:#000000
}
mx|Label
{
color:#000000;
}
</fx:Style>
<fx:Script>
<![CDATA[
import com.adobe.cairngorm.module.IModuleManager;
import mx.core.IVisualElement;
import mx.events.ModuleEvent;
import mx.modules.IModuleInfo;
import mx.modules.ModuleManager;
public var info:IModuleInfo;
[Bindable]
[Inject(id="moduleC")]
public var moduleC:IModuleManager;
private function onStart():void
{
info = ModuleManager.getModule("example/moduleC/ModuleCNonParsley.swf");
info.addEventListener(ModuleEvent.READY, modEventHandler);
info.load(ApplicationDomain.currentDomain, null, null, moduleFactory);
}
private function modEventHandler(e:ModuleEvent):void
{
/* For MX containers, cast to a DisplayObject. */
//vb1.addChild(info.factory.create() as DisplayObject);
/* For Spark containers, cast to a UIComponent. */
vg1.addElement(info.factory.create() as IVisualElement);
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<mx:Label text="this is black"/>
<mx:ModuleLoader url="example/moduleC/ModuleCNonParsley.swf" />
<s:SkinnableContainer id="vg1"/>
<module:ModuleViewLoader id="moduleLoader"
moduleManager="{ moduleC }"
skinClass="com.adobe.cairngorm.module.ModuleViewLoaderSkin">
<module:loadPolicy>
<module:BasicLoadPolicy/>
</module:loadPolicy>
</module:ModuleViewLoader>
</s:Application>