On 7/26/13 5:30 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:
>Hi, > >> OK, I have a fix that passed all mustella tests. > >Can we see the code please? The patch file is copied in below. Basically, the locale setting from flashvars is moved from the ResourceManagerImpl's constructor to the part of the Preloader where it knows it has in fact loaded a resource module and that resource module is loaded. diff --git a/frameworks/projects/framework/src/mx/preloaders/Preloader.as b/frameworks/projects/framework/src/mx/preloaders/Preloader.as index b00e2af..37316fb 100644 --- a/frameworks/projects/framework/src/mx/preloaders/Preloader.as +++ b/frameworks/projects/framework/src/mx/preloaders/Preloader.as @@ -39,6 +39,8 @@ import mx.core.ResourceModuleRSLItem; import mx.core.mx_internal; import mx.events.FlexEvent; import mx.events.RSLEvent; +import mx.managers.SystemManagerGlobals; +import mx.resources.IResourceManager; use namespace mx_internal; @@ -541,6 +543,26 @@ public class Preloader extends Sprite } } + if (resourceModuleListLoader) + { + var resourceManager:IResourceManager; + // do this to prevent dependency on ResourceManager + if (applicationDomain.hasDefinition("mx.resources::ResourceManager")) + { + var resourceManagerClass:Class = + Class(applicationDomain.getDefinition("mx.resources::ResourceManager")); + resourceManager = + IResourceManager(resourceManagerClass["getInstance"]()); + } + // The FlashVars of the SWF's HTML wrapper, + // or the query parameters of the SWF URL, + // can specify the ResourceManager's localeChain. + var localeChainList:String = + SystemManagerGlobals.parameters["localeChain"]; + if (localeChainList != null && localeChainList != "") + resourceManager.localeChain = localeChainList.split(","); + } + timer.removeEventListener(TimerEvent.TIMER, timerHandler); // Stop the timer. diff --git a/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as b/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as index ef01ea6..a51fdba 100644 --- a/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as +++ b/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as @@ -449,14 +449,6 @@ public class ResourceManagerImpl extends EventDispatcher implements IResourceMan compiledLocales[0] : "en_US"; - // The FlashVars of the SWF's HTML wrapper, - // or the query parameters of the SWF URL, - // can specify the ResourceManager's localeChain. - var localeChainList:String = - SystemManagerGlobals.parameters["localeChain"]; - if (localeChainList != null && localeChainList != "") - localeChain = localeChainList.split(","); - var applicationDomain:ApplicationDomain = info["currentDomain"]; var compiledResourceBundleNames:Array /* of String */ =