使用 Flex4 SDK 编译 [英] Compiling with Flex4 SDK

查看:22
本文介绍了使用 Flex4 SDK 编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Flex4 SDK 编译现有的 Flex3 项目.我收到此错误:

I'm trying to compile an existing Flex3 project with the Flex4 SDK. I'm getting this error:

警告:该编译单元没有在 Frame 元数据中指定 factoryClass 来加载配置的运行时共享库​​.要在没有运行时共享库​​的情况下进行编译,请将 -static-link-runtime-shared-libraries 选项设置为 true 或删除 -runtime-shared-libraries 选项.

生成的文件与我旧的 Flex3 编译的 .swf 文件大致相同.在 Flash Player 中播放生成的 .swf 文件也会出现以下错误:

The resulting file is roughly the same as my old Flex3 compiled .swf file. Playing the resulting .swf file in the Flash Player also gives the following errors:

发生 Actionscript 错误:VerifyError:错误 #1014:找不到类 spark.core::SpriteVisualElement

如果我将编译器属性 static-link-runtime-shared-libraries 设置为 true,那么错误就会消失并且一切正常.但是,生成的 .SWF 的大小是 100K 的大.这不是我想要的.

If I set the compiler attribute static-link-runtime-shared-libraries to true, then the error disappears and all is well. However, the size of the resulting .SWF is a couple of 100K's bigger. And that's not what I want.

我不完全理解运行时共享库​​的概念,但似乎将静态链接它们的选项设置为 true,这些库包含在 .swf 中.但是,我喜欢将它们从 .swf 中排除,只在运行时加载所需的库,因为我的项目似乎与 Flex3 有关(顺便说一下,我不知道).

I don't fully understand the concept of runtime shared libraries, but it seems that with the option to statically link them set to true, the libraries are included in the .swf. However, I like to exclude them from the .swf and only load the needed library at runtime, as my project seemed to do with Flex3 (I didn't know that by the way).

如果我理解正确,playerglobal.swc 应该包含我的 .swf 必须加载的外部库的所有必要代码.Flex4 编译的文件需要更多的库吗?我应该对 Frame 元数据标签中的 factoryClass 做些什么吗?

If I understand correctly, playerglobal.swc should hold all the necessary code for the external libraries that my .swf has to load. Do Flex4 compiled files need more libraries? Should I do something with the factoryClass in the Frame metadata tag?

我认为我的问题归结为:如何编译与我以前编译的 Flex3 .swf 大小相同的 Flex4 .swf?

I think my question boils down to this: How do I compile a Flex4 .swf that is the same size as my previous Flex3 compiled .swf?

推荐答案

您必须将 [Frame(factoryClass="path.to.your.preloader")] 添加到主类(您在编译器选项中设置的一个).

You have to add [Frame(factoryClass="path.to.your.preloader")] to the main class (the one you set in the compiler options).

这篇关于使用 Flex4 SDK 编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆