var d:Date = new Date(year,month-1,day);
trace(d.getDay()+1);