03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following example initially creates a new Date object, setting the time <strong>and</strong> date to 8:00<br />

a.m. on May 15, 2004, <strong>and</strong> then uses Date.setMinutes() to change the time to 8:30 a.m.:<br />

var my_date:Date = new Date(2004,4,15,8,0);<br />

trace(my_date.getMinutes()); // output: 0<br />

my_date.setMinutes(30);<br />

trace(my_date.getMinutes()); // output: 30<br />

setMonth (Date.setMonth method)<br />

public setMonth(month:Number, [date:Number]) : Number<br />

Sets the month for the specified Date object in local time <strong>and</strong> returns the new time in<br />

milliseconds. Local time is determined by the operating system on which Flash Player is<br />

running.<br />

Parameters<br />

month:Number - An integer from 0 (January) to 11 (December).<br />

date:Number [optional] - An integer from 1 to 31. If you omit this parameter, the date field<br />

of the specified Date object will not be modified.<br />

Returns<br />

Number - An integer.<br />

Example<br />

The following example initially creates a new Date object, setting the date to May 15, 2004,<br />

<strong>and</strong> uses Date.setMonth() to change the date to June 15, 2004:<br />

var my_date:Date = new Date(2004,4,15);<br />

trace(my_date.getMonth()); //output: 4<br />

my_date.setMonth(5);<br />

trace(my_date.getMonth()); //output: 5<br />

setSeconds (Date.setSeconds method)<br />

public setSeconds(second:Number) : Number<br />

Sets the seconds for the specified Date object in local time <strong>and</strong> returns the new time in<br />

milliseconds. Local time is determined by the operating system on which Flash Player is<br />

running.<br />

324 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!