반응형
statetest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.DateChooser;
function changed(event:Event):void{
var date:DateChooser = DateChooser(event.currentTarget);
var timeString:String = String(date.selectedDate.getFullYear())+"년";
timeString += " "+String(date.selectedDate.getMonth()+1)+"월";
timeString += " "+String(date.selectedDate.getDate())+"일";
mx.controls.Alert.show(timeString);
}
]]>
</mx:Script>
<mx:Panel width="250" height="256" layout="absolute" horizontalCenter="0" verticalCenter="0" title="state test">
<mx:DateChooser horizontalCenter="0" verticalCenter="0" change="changed(event)"/>
</mx:Panel>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.DateChooser;
function changed(event:Event):void{
var date:DateChooser = DateChooser(event.currentTarget);
var timeString:String = String(date.selectedDate.getFullYear())+"년";
timeString += " "+String(date.selectedDate.getMonth()+1)+"월";
timeString += " "+String(date.selectedDate.getDate())+"일";
mx.controls.Alert.show(timeString);
}
]]>
</mx:Script>
<mx:Panel width="250" height="256" layout="absolute" horizontalCenter="0" verticalCenter="0" title="state test">
<mx:DateChooser horizontalCenter="0" verticalCenter="0" change="changed(event)"/>
</mx:Panel>
</mx:Application>
반응형