Has anyone successfully updated Jerryscript’s calendar to work with Flash Player 7?
/****************************************/
//Publish for Flash player 6, not 7. The actionscript version doesn’t matter
// formatting variables, change to suit your needs
todaysColor = ‘0xFFFFFF’;
// the current date’s color
defaultColor = ‘0xB2B2B2’;
// the default date color
todaysSize = 8;
// the current date’s text size
defaultSize = 8;
// the default date size
// note- all fonts must be embed in separate textfields
todaysFont = ‘standard 07_54’;
// the current date’s font
defaultFont = ‘standard 07_54’;
// default date font
// end formatting variables
MovieClip.prototype.makeCalendar = function(xoff, yoff) {
theLevel = this.getLevel();
// begin date initialization
now = new Date();
today = now.getDate();
// get today’s date
month = now.getMonth();
// get the month
year = now.getYear();
// get the year
// use another Date object to find the lastdate
lastdate = new Date(year, month+1, 0);
lastday = lastdate.getDate();
// get the lastdate
daycount = 1;
// variable to keep track of days
weekcount = 0;
// variable to keep track of weeks
// end date initialization
// create the month textfield
months = [‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’];
createTextField(‘monthName’, theLevel+daycount+9, 0, 0, 0, 0);
with (monthName) {
type = ‘static’;
selectable = false;
format = getTextFormat();
format.size = _root.defaultSize;
format.color = _root.defaultColor;
format.font = _root.defaultFont;
setNewTextFormat(format);
autosize = true;
text = months[month];
_x = xoff1.1;
_y = -_root.defaultSize+yoff0.9;
}
// loop through the month’s days and create calendar
while (daycount<=lastday) {
now.setDate(daycount);
// set the date object to current date
weekday = now.getDay();
// find the day of the week
// create the date movie clip
with (this) {
createEmptyMovieClip(daycount, theLevel+daycount+10);
with (eval(daycount)) {
// create the date textfield with position based upon weekday and week counts
createTextField(‘thisDate’, theLevel+daycount+100, 0, 0, 0, 0);
with (thisDate) {
autosize = true;
selectable = false;
text = daycount;
if (today == daycount) {
// if the current day is today, change it’s color
format = getTextFormat();
format.color = _root.todaysColor;
format.size = _root.todaysSize;
format.bold = false;
//Set to false for pixel fonts
format.font = _root.todaysFont;
setTextFormat(format);
} else {
format = getTextFormat();
format.color = _root.defaultColor;
format.font = _root.defaultFont;
format.size = _root.defaultSize;
setTextFormat(format);
}
if (daycount == 1) {
width = _width2;
height = _height2;
}
_x = weekdaywidth+xoff;
_y = weekcountheight+yoff;
}
}
if (weekday == 6) {
weekcount++;
}
// increment the weekcount
daycount++;
// increment the daycount
}
}
// end day creation loop
};
// end calendar prototype
// Sample usage: create a movie clip called calendar
// then call makeCalendar prototype with x/y offset values
_root.createEmptyMovieClip(‘calendar’, 1);
calendar.makeCalendar(200, 100);