Check if selected date is null
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.events.CalendarLayoutChangeEvent; private function useDate(eventObj:CalendarLayoutChangeEvent):void { if (eventObj.currentTarget.selectedDate == null) { return } day.text = eventObj.currentTarget.selectedDate.getDay(); date.text = eventObj.currentTarget.selectedDate.getDate(); month.text = eventObj.currentTarget.selectedDate.getMonth(); year.text = eventObj.currentTarget.selectedDate.getFullYear(); wholeDate.text = eventObj.currentTarget.selectedDate.getFullYear() +"/" +(eventObj.currentTarget.selectedDate.getMonth()+1) + "/" + eventObj.currentTarget.selectedDate.getDate(); } </mx:Script> <mx:DateChooser id="date1" change="useDate(event)" /> <mx:Form> <mx:FormItem label="Day"> <mx:TextInput id="day" width="100" /> </mx:FormItem> <mx:FormItem label="Day of month"> <mx:TextInput id="date" width="100" /> </mx:FormItem> <mx:FormItem label="Month"> <mx:TextInput id="month" width="100" /> </mx:FormItem> <mx:FormItem label="Year"> <mx:TextInput id="year" width="100" /> </mx:FormItem> <mx:FormItem label="Date"> <mx:TextInput id="wholeDate" width="300" /> </mx:FormItem> </mx:Form> </mx:Application>