主文件.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