我正在尝试使用以下代码在远程 SWF 上使用 loadStyleDeclarations(使用 Flex 4.6):
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" initialize="GetFonts()">
<fx:Script>
public function GetFonts():void {
styleManager.loadStyleDeclarations("http://dev.mycompany.com/fonts/fonts.swf");
fontLabel.setStyle('fontFamily', 'Arial');
}
</fx:Script>
<s:Label id="fontLabel" text="This should be Arial!" top="10" />
</s:View>
作为一个 Flex Web 应用程序,这可以完美运行(目标 swf 和消费应用程序都在同一台服务器上,不同的文件夹)。作为 Flex 移动 (iOS) 应用程序,遇到错误:
ReferenceError: Error #1065: Variable mx.core::RSLData is not defined.
at style_mx_core_FlexModuleFactory/info()[style_mx_core_FlexModuleFactory.as:77]
at mx.core::FlexModuleFactory()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:107]
at style_mx_core_FlexModuleFactory()[style_mx_core_FlexModuleFactory.as:35]
VerifyError: Error #1014: Class mx.modules::ModuleBase could not be found.
VerifyError: Error #1014: Class mx.core::FontAsset could not be found.
ReferenceError: Error #1065: Variable style__embed__font_Arial_medium_normal_657631602 is not defined.
ReferenceError: Error #1065: Variable _class_embed_css_Assets_swf_1392078518_mx_skins_cursor_BusyCursor_762190923 is not defined.
有任何想法吗?找到了一种将“-static-link-runtime-shared-libraries=true”添加到构建路径的解决方案,但这并没有解决问题。