Menu

[r513]: / cairngorm3 / trunk / libraries / ModuleTest / src / TestModuleLoader.mxml  Maximize  Restore  History

Download this file

85 lines (66 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.