简体   繁体   English

一个SWF文件中包含多个AS类

[英]Multiple AS classes in one swf file

I'm trying to compile AS files using the mxmlc but the particular class depends on other classes. 我正在尝试使用mxmlc编译AS文件,但是特定的类取决于其他类。 My command is something like this: mxmlc -includes classA classB -source-path=. 我的命令是这样的:mxmlc -includes classA classB -source-path =。 com.example.com.classC. com.example.com.classC。

This gave me classC.swf but when I loaded it, it was still looking for classA.swf and classB.swf. 这给了我classC.swf,但是当我加载它时,它仍然在寻找classA.swf和classB.swf。 Is there anyway I can have just one swf file? 无论如何,我只能拥有一个SWF文件吗?

Thanks! 谢谢!

I assume that classA and classB are .as files. 我假设classA和classB是.as文件。 In that case, you need not use -includes option at all - just import them to your main class ( ClassC ), as you'd normally do and compile using mxmlc com.example.ClassC from the folder that contains the com folder. 在那种情况下,您根本不需要使用-includes选项-只需像通常那样将它们导入到主类( ClassC )中,然后使用mxmlc com.example.ClassC从包含com文件夹的文件夹中进行编译即可。

According to this page , -includes option is to specify a list of classes to the resulting application SWF file, whether or not those classes are required at compile time. 根据此页面-includes选项用于指定生成的应用程序SWF文件的类列表,无论在编译时是否需要这些类。 Normally a class in the source path is compiled only if it is required - ie, only if it used by some other class that is being compiler. 通常,仅在需要时才编译源路径中的类,即,仅当该类被正在编译的其他类使用时才进行编译。 This option tells compiler to compile a class even if it is not used in any of your classes - may be to use getDefinitionByName to create instances of that class at runtime. 此选项告诉编译器编译一个类,即使您的任何类中都没有使用它-可能是在运行时使用getDefinitionByName创建该类的实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM