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

Create successful ePaper yourself

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

Example<br />

The following example uses the constructor to create a Date object based on the current time,<br />

<strong>and</strong> uses the getMinutes() method to return the minutes value from that object:<br />

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

trace(my_date.getMinutes());<br />

getMonth (Date.getMonth method)<br />

public getMonth() : Number<br />

Returns the month (0 for January, 1 for February, <strong>and</strong> so on) of the specified Date object,<br />

according to local time. Local time is determined by the operating system on which Flash<br />

Player is running.<br />

Returns<br />

Number - An integer.<br />

Example<br />

The following example uses the constructor to create a Date object based on the current time<br />

<strong>and</strong> uses the getMonth() method to return the month value from that object:<br />

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

trace(my_date.getMonth());<br />

The following example uses the constructor to create a Date object based on the current time<br />

<strong>and</strong> uses the getMonth() method to display the current month as a numeric value, <strong>and</strong><br />

display the name of the month.<br />

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

trace(my_date.getMonth());<br />

trace(getMonthAsString(my_date.getMonth()));<br />

function getMonthAsString(month:Number):String {<br />

var monthNames_array:Array = new Array("January", "February", "March",<br />

"April", "May", "June", "July", "August", "September", "October",<br />

"November", "December");<br />

return monthNames_array[month];<br />

}<br />

getSeconds (Date.getSeconds method)<br />

public getSeconds() : Number<br />

Returns the seconds (an integer from 0 to 59) of the specified Date object, according to local<br />

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

314 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!