I am attempting to build a calendar chooser component that generates 
and sends the selected date to other custom components. The code is 
listed below and the problem I am having is no matter what date is 
selected in the date chooser, the variable I bound never changes so 
consequently the event sends only the current date. Any help on what 
I am not seeing with this.

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="initComp()">
<mx:Metadata>
[Event(name="dateSelection", type="events.DateSelectionEvent")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import events.DateSelectionEvent;
import mx.controls.Alert;
[Bindable]
private var currentDate:Date = new Date();
private function initComp():void {
//dateSelectEventGeneration();
}
private function dateSelectEventGeneration():void {
trace('event Date ' + currentDate);
if(currentDate !=null){
var e:DateSelectionEvent = new DateSelectionEvent
(currentDate, "dateSelection");
dispatchEvent(e);
}
}
//create event to send date
]]>
</mx:Script>
<mx:DateChooser id="dateSelectID" selectedDate="{currentDate}"
click="dateSelectEventGeneration()"/>
</mx:HBox>


Thanks

Don

Reply via email to