development: resources
 
wrok / clients
flash games
flash projects
web sites
client list
 
Development (R&D)
resources
current development
 
about artifact interactive
contact

 

Hi,

every now and then I get an email about this calendar - it's old - really old - built back in the days of flash 4!! way back in 2000.

I don't really recommend using it - it probably doesn't even work - the security settings in flash change a lot since then.

However, I do have Flash MX component version of the calendar it's easier to use, more flexible and might even work! check it out - it's old but not as old as this.

regards

David Doull - June 2007

This is a calendar application built using Flash 4.
It was developed by David Doull of Artifact Interactive.

You may use this file freely on commercial or noncommercial web sites.
You may modify this file to your hearts content.
It would be nice (but not required) if you mention this site or Artifact Interactive on your sites credits page if you use this file.

There was once a thread about this on were-here.com but since they removed the flash 4 forum it has gone.

There is a much better version of this calendar as a flash MX component included in the book Flash Components Most Wanted.

 
  Source Files  
 

The source files were last updated on 28th April 2000:

There are two versions of the source file: a Javascript version and an ASP version.

The Javascript version uses Javascript to pass the current date to the swf file and the event details are stored in a text file. The ASP version uses an ASP page to pass the current date and time as well as the event details.

Thanks heaps to Sam Wan(Woozle) for the ASP version.

The changes to the code include:
Fixed a few bugs relating to selecting and highlighting the first day of the month - this used to do a few wierd things but now works fine.
Javascript now works on Netscape 3

The new source files can be accessed here:

Javascript version:

aicalendar01.zip (zipped file containing fla, swf, txt and html files listed below - 30K)

aicalendar01.fla
The source flash file - you will need a copy of Macromedia Flash 4 to edit this file. It has been provided so that you can modify or customize the calendar. Or just if you are curious as to how it works.

aicalendar01.swf
This is the flash file that you put on your web site.

aicalendar01.html
This is the html file which includes the required Javascript to pass the current date to the flash file - see the section 'how it works' below for more info.

cal.txt
This is the text file that contains the details for the calendar i.e.: it contains the information of what is on what day. The details from this text file are loaded into the flash file. There is a specific way this needs to be structured, see the section 'the text file format' below for more information.

ASP version:

aicalendar01ASP.zip (zipped file containing fla, swf, asp and html files)

aicalendar01ASP.fla

aicalendar01ASP.swf

aicalendar01ASP.html

 
  How it works  
 

There are three parts to this flash calendar.

The first part is the swf file (i.e.: the flash file). This contains all the graphics and actionscript to build the calendar. It uses functionality built into Flash 4 so you will need the Flash 4 plug-in to view it and if you wish to modify the source file you will need version 4 of Macromedia's Flash application.

It makes use of the duplicate movie clip feature in Flash 4 to create the calendar for each month. It starts with the first day of the month (a blue square) and works through a loop duplicating and repositioning the square for each day in the month.

It uses a Julian date calculation to ensure that the month begins on the correct weekday.

It is passed the current date via Javascript (or ASP) in the html page and displays the current month and year and highlights the current day.

It reads from a text file called cal.txt the details for whats on for each day and highlights those days that have something recorded against them. If the user clicks on a day that has something recorded against it, the details will be displayed in the box next to the calendar. The use of this text file means that it is very easy to maintain - if you want to add a new event to the calendar, you simply add a new line in the text file and reupload it to your web server - no need to modify the flash file. See the section 'the text file format' below for more information.

There are quite a few comments within the actionscript so hopefully you will be able to understand whats going on.

The second part of the calendar is the html file. It is important to use this file not a html file created during publish in flash because this file contains extra Javascript code to pass the current day, month and year to the swf file. The Javascript code is a modified version of code provided by Matt Wobensmith of Macromedia Technical support.

We cant really guarantee that this code will work under all circumstances - if you find that the flash file is stuck on the getting data frame then it is probably because the Javascript has not successfully passed the date to the flash file. Javascript tends to perform a little strangely in some environments - such as on the Mac and with older browsers. The most reliable solution may be to use a bit of server scripting (eg: Perl or ASP) to pass the current date to the swf. See above for ASP version.

The third part of the calendar is the text file. This contains the details of whats on each day in the calendar. The calendar works such that you need only enter something in the text file if there is something on that day. ie: you dont need to put blank entries in if there is nothing.

Please Note: you can also put event details in the flash file as standard set variable statements - in the file provided there are three sample entries in the actionscript on the first frame of the movie - you may wish to delete or change these.

 
  The text file format  
 

The text file that contains the details for days in the calendar has to be structured in a particular format.

If you have a look at the text file this syntax/structure should be quite obvious

eg:

e01262000=David Doull's birthday 
&e01122001=just another day 
&e03182000=Dates are in US format.
&ready=1

The details for each day are defined as a name / value pair. First you put the variable name -which should be structured as follows: the letter e, then the month as two digit number (so march is 03), then the day as two digit number, then the year as a four digit number. This defines the variable name. You then put and = sign and follow that with the details for that day. Note that each pair should be joined by a & symbol - which basically means that you should ensure that there is an & before every variable name except the first (as shown above). You should also include the &ready=1 at the end of the text file - this is a variable that is used to indicate to the flash actionscript that the details have been loaded in. If you find that the flash file is stuck on the 'getting data' frame it may be because you've left this line off.

NB: The Macromedia Flash Manual suggest that text string such as these need to be url encoded with spaces replaced by + symbols etc. This doesn't seem to be the case in this situation.

 
  Credits  
 

This flash application was design and developed by David Doull of Artifact Interactive.

Thanks heaps to Sam Wan for the ASP version.

The idea was for the file was inspired by a question to the 'Flasher' email list by John (sorry I dont know last name)

 

Back the main Development : Resources page