Listing 1

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
 <mx:Script>
  <![CDATA[
   import mx.resources.ResourceBundle;
   [ResourceBundle("helloWorld")]
   private static var rb:ResourceBundle;
   private function geti18nText(key:String):String{
    return rb.getString(key);
   }
  ]]>
 </mx:Script>
 <mx:Label fontSize="50" text="@Resource(key='hello', bundle='helloWorld')"/>
 <mx:Label fontSize="50" text="{geti18nText('welcome')}"/>
</mx:Application>


Listing 2

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
 layout="vertical" creationComplete="doLangChange()">
 <mx:Script>
  <![CDATA[
   import mx.formatters.DateFormatter;

   import mx.resources.ResourceBundle;
   [ResourceBundle("helloWorld_us")]
   private var rb_us:ResourceBundle;
   [ResourceBundle("helloWorld_uk")]
   private var rb_uk:ResourceBundle;
   [ResourceBundle("helloWorld_fr")]
   private var rb_fr:ResourceBundle;
   [Bindable]
   private var today:Date = new Date();
   [Bindable(event="langChange")]
   private function geti18nText(key:String):String{
    return this["rb_"+lang.selectedItem.lang].getString(key);
   }
   [Bindable(event="langChange")]
   private function geti18nDate(dt:Date):String{
    var formatter:DateFormatter = new DateFormatter();
    formatter.formatString = geti18nText("dtformat");
    return formatter.format(dt);
   }
   private function doLangChange():void{
    var e:Event = new Event("langChange");
    this.dispatchEvent(e);
   }
  ]]>
 </mx:Script>
 <mx:DateFormatter id="smeNme" formatString="MM/DD/YYYY"/>
 <mx:ApplicationControlBar dock="true">
  <mx:ComboBox id="lang" change="doLangChange()">
   <mx:dataProvider>
    <mx:Object label="US English" lang="us"/>
    <mx:Object label="UK English" lang="uk"/>
    <mx:Object label="French" lang="fr"/>
   </mx:dataProvider>
  </mx:ComboBox>
 </mx:ApplicationControlBar>
 <mx:Label fontSize="50" text="{geti18nText('hello')}"/>
 <mx:Label fontSize="50" text="{geti18nText('welcome')}"/>
 <mx:Label fontSize="50" text="{geti18nDate(today)}"/>
</mx:Application>