尝试使用运行时共享库​​时出现“错误#1014:无法找到类mx.core :: BitmapAsset”

时间:2011-08-08 22:35:03

标签: flex actionscript-3 flashdevelop rsl

我为我的项目创建了一个运行时共享库​​,我们称之为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”。

任何人都有任何关于从哪里开始的线索/想法?

3 个答案:

答案 0 :(得分:1)

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

你要做的就是告诉它要使用的swf的位置,以及它中的类(swc arg)

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

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

你知道创建一个swc 不是一个RSL,对吗? swc =编译时库。 swf =运行时库(如果它是Adobe签名的库,则为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