Date.getDay( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
Date.getDay( ) Method Flash 5

the day of the week
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");


    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net