We can also send parameters to the Date() object in ActionScript 3.0 by
placing values into the parenthesis. This gives us a method to set times
and dates, or augment the value of a Date() object we have. We can run
operations to see if dates match, are less than or greater than, and
many other operations that our ActionScript 3.0 projects call for.
Defining Parameters for the Date()
object
In the following example we create three different Date() objects to
hold separate values defined by our parameters
var date1:Date = new Date();
trace(date1); // now
var date2:Date = new Date(2004, 11, 25);
trace(date2); // Christmas 2004
var date3:Date = new Date(2002, 5, 6, 9, 30, 15, 0);
trace(date3); // Thu Jun 6 09:30:15 GMT-0400 2002
Tue Aug 4 08:41:15 GMT-0400 2009
Sat Dec 25 00:00:00 GMT-0500 2004
Thu Jun 6 09:30:15 GMT-0400 2002