0; --i){ if(ResourceManager.getInstance().getLocales()[i-1] != "en_US"){ ResourceManager.getInstance().removeResourceBundlesForLocale(ResourceManager.getInstance().getLocales()[i-1]); } else{ bundles = ResourceManager.getInstance().getBundleNamesForLocale("en_US"); for(var j:int = 0; j < bundles.length; ++j){ if( bundles[j] != "styles" && bundles[j] != "containers" && bundles[j] != "skins" && bundles[j] != "effects" && bundles[j] != "core" ){ ResourceManager.getInstance().removeResourceBundle("en_US", bundles[j]); } } } } } /* * We may or may not have something to unload, so we can't blindly call unload() and wait * for an unload event. */ private function handleUnload():void{ if(application.ml.child != null){ application.ml.unloadModule(); } else{ application.ml.dispatchEvent(new ModuleEvent("unload")); } } // Event handlers private function handleResourceErrorEvent(e:ResourceEvent):void{trace("Resource Error Event: " + e.toString())} private function handleResourceProgressEvent(e:ResourceEvent):void{trace("Resource Progress Event: " + e.toString())} private function handleResourceCompleteEvent(e:ResourceEvent):void{trace("Resource Complete Event: " + e.toString())} private function handleModuleErrorEvent(e:ModuleEvent):void{trace("Module Error Event: " + e.toString())} private function handleModuleProgressEvent(e:ModuleEvent):void{trace("Module Progress Event: " + e.toString())} private function handleModuleReadyEvent(e:ModuleEvent):void{trace("Module Ready Event: " + e.toString())} private function handleModuleUnloadEvent(e:ModuleEvent):void{trace("Module Unload Event: " + e.toString())} ]]>