03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Modifiers Signature Description<br />

static UTC(year:Number,<br />

month:Number,<br />

[date:Number],<br />

[hour:Number],<br />

[minute:Number],<br />

[second:Number],<br />

[millisecond:Number]<br />

) : Number<br />

Methods inherited from class Object<br />

Date constructor<br />

public Date([yearOrTimevalue:Number], [month:Number], [date:Number],<br />

[hour:Number], [minute:Number], [second:Number], [millisecond:Number])<br />

Constructs a new Date object that holds the specified date <strong>and</strong> time.<br />

The Date() constructor takes up to seven parameters (year, month, ..., millisecond) to specify<br />

a date <strong>and</strong> time to the millisecond. Alternatively, you can pass a single value to the Date()<br />

constructor that indicates a time value based on the number of milliseconds since January 1,<br />

1970 0:00:000 GMT. Or you can specify no parameters, <strong>and</strong> the Date() date object is<br />

assigned the current date <strong>and</strong> time.<br />

For example, this code shows several different ways to create a Date object:<br />

var d1:Date = new Date();<br />

var d3:Date = new Date(2000, 0, 1);<br />

var d4:Date = new Date(65, 2, 6, 9, 30, 15, 0);<br />

var d5:Date = new Date(-14159025000);<br />

In the first line of code, a Date object is set to the time when the assignment statement is run.<br />

In the second line, a Date object is created with year, month, <strong>and</strong> date parameters passed to it,<br />

resulting in the time 0:00:00 GMT January 1, 2000.<br />

486 <strong>ActionScript</strong> classes<br />

Returns the number of milliseconds between midnight<br />

on January 1, 1970, universal time, <strong>and</strong> the time<br />

specified in the parameters.<br />

valueOf() : Number Returns the number of milliseconds since midnight<br />

January 1, 1970, universal time, for this Date.<br />

addProperty (Object.addProperty method), hasOwnProperty<br />

(Object.hasOwnProperty method), isPropertyEnumerable<br />

(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf<br />

method), registerClass (Object.registerClass method), toString<br />

(Object.toString method), unwatch (Object.unwatch method), valueOf<br />

(Object.valueOf method), watch (Object.watch method)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!