Unable to load (packaged) locales on iOS
Hi, for last couple of days I am struggling with loading locales (of course it works on Android and in fast packaging on iOS 🙂 ).
Its flex project with AIR SDK 3.7 (without ASC 2.0) and Flex SDK 4.6, FB 4.7. Here's my test app:
loader = new Loader();
var url:URLRequest = new URLRequest("assets/locales/en_US.swf");
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loader.load(url, loaderContext);
after its successfully loaded I use ModuleManager..
modInfo = ModuleManager.getModule("assets/locales/en_US.swf");
modInfo.load(ApplicationDomain.currentDomain, null, loader.contentLoaderInfo.bytes, FlexGlobals.topLevelApplication.moduleFactory);
Result is that it stucks with loading the data to the ModuleManager with the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::FlexModuleFactory/getDefinitionByName()
at mx.core::FlexModuleFactory/docFrameHandler()
at mx.core::FlexModuleFactory/docFrameListener()
at mx.core::FlexModuleFactory/docFrameListener()
I've also tried ResourceManager.loadResourceModule but it throws the same error (I guess it works the same way)
The en_US.swf file is generated with this script:
<exec dir="${APP_ROOT}" executable="C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\bin\mxmlc.exe" failonerror="true">
<arg line="-locale=en_US" />
<arg line="-static-link-runtime-shared-libraries=true -verify-digests=false" />
<arg line="-source-path='${APP_ROOT}/resources/locale/{locale}'" />
<arg line="-include-resource-bundles=rpxLocale"/>
<arg line="-swf-version=20" />
<arg line="-target-player=11.7" />
<arg line="-output='${outdir}/assets/locales/en_US.swf'" />
</exec>
A note: strange is that loading styles with StyleManager works for me:
styleManager.loadStyleDeclarations2("assets/css/style.swf", true, ApplicationDomain.currentDomain);
Thank you for any thoughts!
Peter