0

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

4

1 回答 1

0

只需将 Application 标签重命名为 Module 中的mod1.swf. 模块加载器将无法处理应用程序标记swf

于 2013-06-27T07:09:03.480 回答