Name

Date.getDay( ) Method — the day of the week

Availability

Flash 5

Synopsis

date.getDay( )

Returns

An integer from 0 (Sunday) to 6 (Saturday), representing the day of the week for date.

Example

The following code loads a .swf file specific to the current day of the week into the movie clip welcomeHeader (the seven .swf files are named in the series sun.swf, mon.swf, and so on):

now = new Date( );
today = now.getDay( );
days = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
welcomeHeader.loadMovie(days[today] + ".swf");

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.