0 Replies Latest reply on May 20, 2009 9:04 AM by iamfuric

    Locale aware Tree labelFunction

    iamfuric

      Hi all

      I'm in need to implement tree labelFunction that is locale aware, here is the example :

       

      class Localization{

       

          

       

       

       

       

       

       

       

       

       

       

       

       

      public

       

      function setLocale(locale:String):void{

       

       

       

       

       

           this.dispatchEvent(localizationChangeEvent);

       

      }

       

       

       

       

           [Bindable(event="localizationChange")]

       

       

       

       

       

           public function getLabel(key:String):String{

                return label according to locale

           }

       

       

      }

       

       

      <mx:Script>

      <![CDATA[

           

          private function myLabelFunc(item:*):String{

                return  localization.getLabel(item.data);

          }

       

      ]]>

       

       

      </mx:Script>

      <mx:tree labelFunction="myLabelFunc"  dataProvider=....../>

       

      My problem is that  when locale is changed i don't see labels change to selected language...

      Please advise