# Updating calendar for Flash Player 7

**URL:** <https://forum.kirupa.com/t/updating-calendar-for-flash-player-7/201271>\
**Category:** flash\
**Created:** [September 19, 2006, 10:38pm UTC](https://forum.kirupa.com/t/updating-calendar-for-flash-player-7/201271 "2006-09-19T22:38:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [September 19, 2006, 10:38pm UTC](https://forum.kirupa.com/t/updating-calendar-for-flash-player-7/201271/1 "2006-09-19T22:38:30Z")

</div>

Has anyone successfully updated Jerryscript’s calendar to work with Flash Player 7?

> **[Calendar in Flash MX](https://www.kirupa.com/forum/showthread.php?t=49179)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

//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 = xoff_1.1;  
\_y = -\_root.defaultSize+yoff_0.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 = \_width_2;  
height = \_height_2;  
}  
\_x = weekday_width+xoff;  
\_y = weekcount_height+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);
