使用Flex4 SDK编译

发布于 2024-09-06 07:23:18 字数 839 浏览 4 评论 0原文

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

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

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

发生 Actionscript 错误:VerifyError: Error #1014: Class spark.core::SpriteVisualElement 无法找到

如果我设置编译器将 static-link-runtime-shared-libraries 属性设置为 true,然后错误就会消失,一切都会好起来。然而,生成的 .SWF 的大小要大几个 100K。这不是我想要的。

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

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

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

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

Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.

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:

An Actionscript error ocurred: VerifyError: Error #1014: Class spark.core::SpriteVisualElement could not be found

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.

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).

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?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你在看孤独的风景 2024-09-13 07:23:18

您必须将 [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).

泅渡 2024-09-13 07:23:18

Flex3 默认情况下不使用 rsls,但您可以启用它们。 Flex4 rsls 默认启用,请参阅:http://help.adobe .com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7add.html

运行时共享库​​的概念是:分割应用程序的一部分,该部分也由其他应用程序(重新)使用,从而只需要用户下载一次。这不会在第一次下载时保存任何内容,但会在以后的下载时保存。您可以制作自己的 rsl,但主要是 adobe 提供的那些旨在产生差异:由于“每个人”都会使用它们,因此您需要的库有可能已经存在于用户的系统上,因此加快应用程序的下载时间。

Playerglobal.swc 从未包含任何 Flex 框架类,其中大多数位于 Flex.swc 和 Framework.swc 中(标准 Flex 3 项目还包括 rpc.swc 和utilities.swc - 我没有检查,但这些可能包含一些 Flex 部分以及)

Flex3 did not use rsls by default but you could enable them. Flex4 rsls are enabled by default, see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7add.html

The concept of runtime shared libraries is: splitting of a part of your application that is (re)used by other apps as well, thereby only requiring the user to download it once. This won't save anything on the first download but will save on later downloads. You could possibly make your own rsl, but it's mostly the ones provided by adobe that are meant to make the difference: Since 'everybody' will use them there will be a bit chance the library you need is already present on the user's system, thereby speeding up the download-time of your app.

playerglobal.swc never contained any flex framework classes, most of them are in flex.swc and framework.swc (a standard flex 3 project also includes rpc.swc and utilities.swc - I didn't check but these probably contain some flex parts as well)

古镇旧梦 2024-09-13 07:23:18

看来您可能遇到项目迁移问题。您可能想阅读以下内容:

http://www.adobe .com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html

这是一篇非常好的文章,概述了迁移的不同可能性,具体取决于您想要使用的 Flex4 内容的数量。

Looks like you might have project migration problems. You might want to read up on the process on:

http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html

It's a really good article with overview of different possibilities for migration, depending on the amount of Flex4 stuff you want to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文