<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function getValue():void
{
v.text = DateField1.text;
}
public function initValue():void
{
DateField1.monthNames=["一月", "二月", "三月", "四月", "五月",
"六月", "七月", "八月", "九月", "十月", "十一月",
"十二月"];
DateField1.dayNames=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var d:Date = new Date();
d.setFullYear(1985,07,19);
DateField1.selectedDate = d;
DateField1.formatString = "YYYY年MM月DD日";
}
]]>
</mx:Script>
<mx:DateField x="131" y="106" id="DateField1" focusIn="initValue();"/>
<mx:Button x="131" y="177" label="选择" click="getValue();" fontSize="12"/>
<mx:TextArea x="274" y="107" width="178" height="47" id="v"/>
</mx:Application>