我为我的项目制作了运行时共享库,我们称之为ResourceLibrary。它包含我项目的所有嵌入式资源(图像,声音,影片剪辑),并且在许多其他代码位中用作单例。尝试使用运行时共享库时出现“错误#1014:类mx.core :: BitmapAsset”
我使用这个批处理(不幸的是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链接运行时共享库 = 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.
我已经扒了我的大脑在这个可能超简单的解决方案,但我到处寻找答案在其他人获取的是“静-link-runtime-shared-libraries to true“。
任何人都有从哪里开始的线索/想法?
谢谢!我一直在用MXMLC编译模块时遇到问题 - 编译器不会将ModuleBase类嵌入到需要它的那些类中。最终,最终的解决方案来自于确保每个模块都使用'-static-link-runtime-shared-libraries = true'编译,并为每个模块指定每个RSL及其路径。 –