The name of the config file used is set in com.esri.viewer.ViewerContainer.mxml in the setConfigFile function:
private function setConfigFile():void
{
//retrieve FlashVars.
var flashvarConfig:String = FlexGlobals.topLevelApplication.parameters.config;
if (flashvarConfig)
{
configFile = flashvarConfig;
}
//retrieve config from URL and override FlashVar
if (urlConfigParams.config)
{
configFile = urlConfigParams.config;
}
}
If you don't pass a config parameter in the URL then flashvarConfig is used, which represents config.xmlYou can change things in this function.For example here's my own setConfigFile function where I've added a section to get the config from a Cookie.
private function setConfigFile():void
{
//retrieve FlashVars.
var flashvarConfig:String = FlexGlobals.topLevelApplication.parameters.config;
if (flashvarConfig)
{
configFile = flashvarConfig;
}
//retrieve config from Cookie and override FlashVar
var cookie:Object = CookieUtil.getCookie("config");
if (cookie){
configFile = cookie.toString();
CookieUtil.deleteCookie("config");
}
//retrieve config from URL and override FlashVar and Cookie
if (urlConfigParams.config)
{
configFile = urlConfigParams.config;
}
}
So you need to change the value of the configFile variable for your ViewerContainer somehow. Maybe what you could do is hardcode it in setConfigFile(), use a specific config-abc.xml depending on the id of each ViewerContainer.