Я сделал это недавно, используя классы flah.globalization: посмотрите очень информативно о получении локали и т. Д. http://www.adobe.com/devnet/flashplayer/articles/flash_globalization_package.html вот мой код:
не забудьте вызвать init ();на создание завершено!
<fx:Script>
<![CDATA[
import flash.globalization.DateTimeFormatter;
import flash.globalization.DateTimeStyle;
import flash.globalization.StringTools;
import mx.collections.ArrayCollection;
import spark.events.IndexChangeEvent;
[Bindable]
private var listColl:ArrayCollection;
private var localeList:Array = new Array("en-US", "fr-FR", "es-ES","ja-JP", "hi-IN","ru-RU");
private var country:String;
private function init():void{
// set the dp for drop down;
listColl = new ArrayCollection(localeList);
country = localeList[0];
}
private function doDateLabel(item:Date):String {
trace("input = " + item);
if(item != null) {
var locale:String = country;
if(locale != null){
var dtf:DateTimeFormatter = new DateTimeFormatter(locale);
dtf.setDateTimeStyles(DateTimeStyle.SHORT, DateTimeStyle.NONE);
/*
DateTimeSyle.MEDIUM
DateTimeSyle.LONG
*/
var shortDate:String = dtf.format(item);
trace(shortDate + " (" + dtf.getDateTimePattern() + ")");
}
}
return shortDate;
}
protected function dropDownList_changeHandler(evt:IndexChangeEvent):void {
country = countryList.selectedItem;
}
]]>
</fx:Script>
<s:HGroup width="100%" height="100%" gap="20" top="50" left="50">
Hope that's what you were after
<mx:DateField id="begin" width="200"
showToday="true"
labelFunction="doDateLabel"
parseFunction="null"/>
<s:DropDownList id="countryList"
requireSelection="true" prompt="Please select an Country"
horizontalCenter="0" top="20" dataProvider="{listColl}"
change="dropDownList_changeHandler(event);">
</s:DropDownList>
</s:HGroup>