<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:myControls="com.savage7.controls.*"
layout="absolute"
viewSourceURL="srcview/index.html" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#BDBDBD, #FFFDE3]">
<mx:Metadata>
[ResourceBundle("myResources")]
</mx:Metadata>
<mx:TitleWindow width="370" height="180" layout="absolute" horizontalCenter="0" verticalCenter="0" title="Localized Component Sample">
<myControls:Label x="128.5" y="58" text="localized text goes here ..." resourceName="myLocalizedLabel" resourceBundle="myResources"/>
<myControls:Button x="128" y="82" label="localized text goes here..." resourceName="myLocalizedButton" resourceBundle="myResources" cornerRadius="0" paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5"/>
<mx:Label y="120" text="(hover mouse pointer over each control to see localized tool tip)" horizontalCenter="0" fontSize="9" fontStyle="italic" color="#949494"/>
<mx:ApplicationControlBar x="0" y="0" cornerRadius="0" width="100%" dock="true" fillAlphas="[1.0, 1.0]" fillColors="[#E6E6E6, #CBCBCB]">
<mx:Label text="Select Locale: " fontWeight="bold"/>
<mx:ComboBox dataProvider="{['en_US','fr_FR','es_ES', 'ja_JP']}" change="selectLocale(event);"></mx:ComboBox>
</mx:ApplicationControlBar>
<mx:Label text="Localized Label:" fontWeight="bold" x="10" y="58"/>
<mx:Label text="Localized Button:" fontWeight="bold" x="10" y="84"/>
</mx:TitleWindow>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
/**
* handles locale combo box change event when
* user selects a different locale to display
*/
private function selectLocale(event:Event):void
{
var localeChain:Array = new Array(1);
localeChain[0] = event.target.selectedItem.toString();
resourceManager.localeChain = localeChain;
}
]]>
</mx:Script>
</mx:Application>