3

我为我的项目制作了一个运行时共享库​​,我们称之为 ResourceLibrary。它包含我项目的所有嵌入式资产(图像、声音、电影剪辑),并且在许多其他代码位中用作单例。

我正在使用这批编译它(不幸的是Windows):

SET normalstuff=--namespace+=http://ns.adobe.com/mxml/2009,${flexlib}/mxml-2009-manifest.xml --namespace+=http://www.adobe.com/2006/mxml,${flexlib}/mxml-manifest.xml --namespace+=library://ns.adobe.com/flex/spark,${flexlib}/spark-manifest.xml -external-library-path lib -external-library-path+=${flexlib}/libs -external-library-path+=${flexlib}/libs/player/10.0
call compc -source-path src/ -output lib-ext/resources.swc -include-namespaces+=http://MYPROJECT -namespace+=http://MYPROJECT,confs/ResourceLibrary-manifest.xml %normalstuff% -library-path+=data/characters -library-path+=data/menus -library-path+=data/icons/relationships  -include-lookup-only=true 

这就是我的 resources.swc 文件,当我在我的库中包含这个 swc 并且-static-link-runtime-shared-libraries =true 时。但我不想在我的主 swf 中嵌入我的运行时共享库​​(将文件大小从 10mb 减少到 ~3mb),所以static-link-runtime-shared-libraries必须为 false。

然而,当我运行我的代码时,我得到了这个错误:

[Starting debug session with FDB]
[Fault] exception, information=VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.

我一直在思考这个可能超级简单的解决方案,但无论我在哪里看到其他人得到的答案都是“static-link-runtime-shared-libraries to true”。

有人对从哪里开始有任何线索/想法吗?

4

3 回答 3

1

我想通了,但忘了在这里发帖。

您需要做的是告诉它要使用的 swf 的位置,以及其中将包含哪些类(swc arg)

-runtime-shared-library-path=lib/MyLibrary.swc,MyLibrary.swf

然后我提取 swc(使用 7zip,但任何工作)并将提取的 swf 重命名为“MyLibrary.swf”,并将其移动到与我的主程序相同的目录中。

于 2011-09-02T23:32:45.020 回答
0

如果您使用的 SDK 与您使用的 Flash Builder 版本不匹配,您可能需要在项目属性中手动链接到该 SDK。

于 2011-08-08T23:18:07.140 回答
0

您知道创建 swc不是RSL,对吗?swc = 编译时库。swf = 运行时库(如果是 Adob​​e 签名的库,则为 swz)。

http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_01.html#168690 http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14 .html

于 2011-08-09T02:00:59.210 回答