使用Flex4 SDK进行编译

Mon*_*kai 4 apache-flex flash actionscript-3 mxmlc flex4

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

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.

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

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

如果我将编译器属性设置static-link-runtime-shared-libraries为true,则错误消失,一切都很好.但是,由此产生的.SWF的大小是几个100K的大.这不是我想要的.

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

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

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

小智 5

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