Flash 将首先在哪里查找类定义:在 AS 文件(源路径)中还是在链接的 SWC 文件(库路径)中?
我想通过将一些包或包的一部分预编译成 SWC 文件来加速大型 Flash IDE 项目的编译,我将其包含在 Flash 发布设置下的高级 AS3 设置的“源路径”部分中。
问题是我不知道编译器将首先在哪里查找类定义,因为它应该(理论上)能够在 SWC 和源路径中找到类定义,因为 SWC 的源位于源路径中(即主FLA 和链接的SWC 共享相同的源路径或根目录)。
虽然您可以安排源路径(包括 AS 文件的路径)的顺序,并且可以安排库路径(SWC 文件的路径或包含 SWC 文件的文件夹的路径)的顺序,但您无法指定是在源路径还是库路径中搜索定义第一的。
是否会使用库路径(AS 文件)或源路径(SWC 文件)中的类定义?尽管它们可能代表相同的类定义,但除非使用 SWC 文件,否则我不会看到编译时间减少。
编辑: 我发现的唯一文档说“如果您使用库路径中,请确保 SWC 文件中的已编译代码不会在源路径中的未编译 AS 文件中重复,冗余代码会减慢 SWF 文件的编译速度。”我喜欢它提到性能影响而不提及实际使用哪个定义:P
I want to accelerate the compilation of a large Flash IDE project by pre-compiling some packages or parts of packages into a SWC file, which I will include in the "Source Path" section of the Advanced AS3 Settings under Flash Publish Settings.
The problem is that I don't know where the compiler will look first for a class definition, given that it should (in theory) be able to find a class definition in both the SWC and the source path, since the source of the SWC is in the source path (i.e. the main FLA and the linked SWC share the same source path or root directory).
While you can arrange the order for source paths (paths including AS files), and you can arrange the order of library paths (paths to SWC files or folders containing SWC files), you cannot specify whether source paths or library paths are searched for definitions first.
Will the class definition in the library path (AS file) or the source path (SWC file) be used? Even though they may represent the same class definition, I will not see my compilation times decrease unless it uses the SWC file.
Edit:
The only documentation I've found says "If you use the Library path, be sure none of the compiled code in the SWC files is duplicated in uncompiled AS files in the Source path. The redundant code will slow down compilation of your SWF file." I love how it mentions the performance hit without mentioning which definition will actually be used :P
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AS 文件是编译器查找的最后部分。所以AS文件会覆盖swc库中的类。
The AS file is the last part the complier look for. So AS file will override the class in swc library.