Basic Tutorial

After installing the component, open Flash MX or Flash MX 2004 and locate the xmlCalendar component in the components panel:

 

Drag the component into the Stage:


 

Give the component an instance name (cal in this example):


 

Change the desired settings in the component property (or Component Inspector) panel:


 

Click here for an explanation of each of the settings.

One of the most common uses of this component is to show you the date that the user clicks on.

Select the frame of the timeline where the component is:


 

Press F9 and add following code using the ActionScript editor:

cal.onDateClick=function()
{
  trace(this.getSelected());
}

This will show the date in the output window when the user clicks on the date button.

The getSelected
method can also reformat the date if you pass the format mask parameter with it.

Here are some date formatting examples:

this.getSelected("dd/mm/yy")
- returns 4/7/04
this.getSelected("mm-dd-YYYY") - returns 7-4-2004

Note that if "Allow Multiple Selection" is set to true in the components panel, an array with date objects will be returned.