Hi all 

I'm trying to create a calendar using the dateChooser component. I am
able to show which dates are selectable, but I can't figure out how to
when I click on the date it will show the event information for that
day from the xml file I provided.  Help please!

Here's a snippet of what I have so far:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="init()">
    <mx:Script>
        <![CDATA[
            private function init():void {
                dc1.displayedMonth = 1;
                dc1.displayedYear = 2008;
            }           
            
            public function displayDates():void {
                var dateRanges:Array = [];
                for (var i:int=0; i<shows.show.length(); i++) { 
                    var cDate:Date = 
                        new Date(shows.show[i].showDate.toString()); 
         
                    var cDateObject:Object = 
                        {rangeStart:cDate, rangeEnd:cDate};
                    dateRanges.push(cDateObject);
                }
                dc1.selectedRanges = dateRanges;
            }           
        ]]>
    </mx:Script>
  
    <mx:XML id="shows" format="e4x">
     <data>
        <show>
         <showID>1</showID>
         <showDate>02/28/2008</showDate>
         <showTime>10:45am/11:15am</showTime>
        </show>
        <show>
         <showID>2</showID>
         <showDate>02/23/2008</showDate>
         <showTime>7:00pm</showTime>
        </show>
     </data>
    </mx:XML>
 
    <mx:DateChooser id="dc1" showToday="true" 
        creationComplete="displayDates()"/>
    
</mx:Application>


Reply via email to