的main.swf
<?xml version="1.0"?>
<!-- modules/StyleModLoaderApp.mxml -->
<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">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|Button {
color:blue;
cornerRadius:10;
}
</fx:Style>
<s:VGroup>
<s:ModuleLoader id="ml1" url="mod1.swf"/>
</s:VGroup>
<s:Button id="myButton" label="Main App Button"/>
</s:Application>
mod1.swf
<?xml version="1.0"?>
<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">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|Button {
color:red;
}
</fx:Style>
<s:VGroup>
<s:Label id="lab1" text="Module 1"/>
<s:Button id="myButton1" label="mod1 button"/>
</s:VGroup>
</s:Application>
为什么会发生这种情况?
Main.swf和mod1.swf都在同一个文件夹中,Main.swf执行正常,但没有mod1.swf按钮,应加载,dwadwadwafeaf
答案 0 :(得分:0)
只需在mod1.swf
中将Application标记重命名为Module即可。模块加载器将无法处理标记为swf
的应用程序。