Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex flex 4加载模块_Apache Flex_Actionscript_Module_Load - Fatal编程技术网

Apache flex flex 4加载模块

Apache flex flex 4加载模块,apache-flex,actionscript,module,load,Apache Flex,Actionscript,Module,Load,有谁能给我举一个如何加载模块的例子吗?例如,如果Modules.user包中有moduleLogin.mxml,如何加载它?我想要mxml和actionscript两种方法。你读过上面的文档了吗 引用一些代码,以下是在MXML中加载它的方式: <?xml version="1.0"?> <!-- modules/MySimplestModuleLoader.mxml --> <s:Application xmlns:fx="http://ns.adobe.

有谁能给我举一个如何加载模块的例子吗?例如,如果Modules.user包中有module
Login.mxml
,如何加载它?我想要mxml和actionscript两种方法。

你读过上面的文档了吗

引用一些代码,以下是在MXML中加载它的方式:

<?xml version="1.0"?>
<!-- modules/MySimplestModuleLoader.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:ModuleLoader url="ColumnChartModule.swf"/>

</s:Application>

你试过什么吗?我在网上查了一下,但什么也没找到。我找到了如何将swf文件作为模块而不是mxml文件加载的信息。OK,但我有module Login.mxml not Login.swf。@Volter没有看到您的代码;很难给出具体的答案。当你说“模块”时,你是不是用这个词来泛指组件?或者你真的扩展了模块类。如果是这样,您必须先将模块编译成SWF,然后才能将其用作模块。我已将mxml模块编译成SWF,但代码不起作用。import spark.ModuleLoader private function test():void{var myLoader:ModuleLoader=new ModuleLoader();myLoader.url=“modules\User\Login.swf”;this.addChild(myLoader);}请量化无效。你会遇到编译时错误或运行时错误吗?@沃尔特也许你应该考虑发布一个新的问题来解释你正在做什么和出了什么问题。请确保包含所有相关代码和您收到的实际运行时错误。
var myLoader : ModuleLoader = new ModuleLoader();
myLoader.url = "ColumnChartModule.swf";
this.addChild(myLoader);