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

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

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

second:Number [optional] - A number; an integer from 0 to 59. If you omit this parameter,<br />

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

millisecond:Number [optional] - A number; an integer from 0 to 999. If you omit this<br />

parameter, the milliseconds field 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 with today's date, uses<br />

Date.setUTCHours() to change the time to 8:30 a.m., <strong>and</strong> changes the time again to 5:30:47<br />

p.m.:<br />

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

my_date.setUTCHours(8,30);<br />

trace(my_date.getUTCHours()); // output: 8<br />

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

my_date.setUTCHours(17,30,47);<br />

trace(my_date.getUTCHours()); // output: 17<br />

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

trace(my_date.getUTCSeconds()); // output: 47<br />

setUTCMilliseconds (Date.setUTCMilliseconds<br />

method)<br />

public setUTCMilliseconds(millisecond:Number) : Number<br />

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

in milliseconds.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Parameters<br />

millisecond:Number - An integer from 0 to 999.<br />

Returns<br />

Number - An integer.<br />

Example<br />

The following example initially creates a new Date object, setting the date to 8:30 a.m. on<br />

May 15, 2004 with the milliseconds value set to 250, <strong>and</strong> uses Date.setUTCMilliseconds()<br />

to change the milliseconds value to 575:<br />

506 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!