Hello list,

I have a project with the resourceManager to have internationalisation 
on the application.

All works fine when I do my stuff into mxml files, but if I add some 
actionScript code into AS code-behind classes, the update seems work 
only if the component has not been viewed.

Example : I have a simple mxml / as component with this code :

mxml :
<?xml version="1.0" encoding="utf-8"?>
<my:mycomp2 xmlns:mx="http://www.adobe.com/2006/mxml"; width="400" 
height="300"
    xmlns:my="*"
    creationComplete="init()">
    <mx:Script>
        <![CDATA[
            override protected function init():void
            {
                // your code here
                // (if really necessary, otherwise code on [Class]Base.as)
               
                super.init();
            }
        ]]>
    </mx:Script>
    <mx:Button id="mybutton"  />
</my:mycomp2>


ActionScript :

package
{
    import mx.containers.Canvas;
    import mx.controls.Button;
    import mx.resources.IResourceManager;
    import mx.resources.ResourceManager;
   
    public class mycomp2 extends Canvas
    {
        public var mybutton:Button;
        public var rm:IResourceManager;
        public function mycomp2()
        {
            rm = ResourceManager.getInstance();
        }
       
        protected function init():void
        {
            this.mybutton.label = rm.getString('myResources', 'fieldEmail');
        }
    }
}



On my main mxml application, I set my resourceManager, and have a 
combobox to select the correct language. On the change handler of the 
combobox, I use :

        private function localeComboBox_changeHandler(event:Event):void
        {
            resourceManager.localeChain = [ localeComboBox.selectedItem ];
            resourceManager.update();
        }



If I don't display first time my component and change the language, the 
component display correctly the update. But since I display the 
component, even only one time, it seems that the ResourceManager 
wouldn't made any change on the actionScript setted values for the 
further displays...

Anybody know this issue / have a solution about it ??

Thanks in advance for any suggestion.

Thierry

Reply via email to