Thursday, May 7, 2009

Set resource file dynamically

Some times we need to set resource file dynamically like we need to set language english / french;
we can do this by passing parameter in flash object.

In script tag in html page we find AC_FL_RunContent() function in that all variable of flash object is set.
we can add variable || "FlashVars", "language=fr_FR" || in that function this variable is give static or dynamic in javascript.

in main Application mxml page's preinitialize event we get setting parameter which given below.

var objLan:String="";
if(Application.application.parameters.hasOwnProperty("language") && Application.application.parameters.language!="")
{
objLan=Application.application.parameters.language;
}
resourceManager.localeChain = [objLan];

No comments: