Allora il problema è che non carica il file XML quando è on line ...
codice:
// hide the calendar while we populate it
calendar_mc._visible = false;
getEvents = new XML();
getEvents.ignoreWhite = true;
// when the data has been loaded
getEvents.onLoad = function () {
// calendar_array will hold the calendar data that has been loaded
var calendar_array = new Array();
var minStartDate = this.firstChild.attributes.startDate.parseDate();
var maxEndDate = this.firstChild.attributes.endDate.parseDate();
// minStartDate and maxEndDate are used to set the displayRange
calendar_ec. setDisplayRange({begin:minStartDate,end:
maxEndDate});
// loop over the event nodes in the xml
// and stores the record as an object inside calendar_array
var qNodes = this.firstChild.childNodes;
for (var q=0; q<qNodes.length; q++) {
var d = qNodes[q].attributes;
calendar_array.push({title:d.title,description:d.description,startDate:d.startDate.parseDate(),endDate:d.endDate.parseDate(),allDay:Boolean(d.allDay),eventType:d.eventType,pattern:qNodes[q].firstChild});
}
// passo l' array del calendario
calendar_ec.setDataProvider(calendar_array);
// show the calendar now it is ready
calendar_ec._visible = true;
// simulo il click su ogni giorno del calendario
calendar_ec.getDayByDate(new Date().getDate()).onRelease();
}
// Carico il file XML
getEvents.load("calendario.xml");
Il calendario diventa visible, quindi nell' onLoad ci passa, ma in rosso ho segnato quello che a parere mio, forse non è corretto!!
Che ne dite?