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.

setYear (Date.setYear method)<br />

public setYear(year:Number) : Number<br />

Sets the year 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 />

year:Number - A number that represents the year. If year is an integer between 0 <strong>and</strong> 99,<br />

setYear sets the year at 1900 + year; otherwise, the year is the value of the year parameter.<br />

Returns<br />

Number - An integer.<br />

Example<br />

The following example creates a new Date object with the date set to May 25, 2004, uses<br />

setYear() to change the year to 1999, <strong>and</strong> changes the year to 2003:<br />

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

trace(my_date.getYear()); // output: 104<br />

trace(my_date.getFullYear()); // output: 2004<br />

my_date.setYear(99);<br />

trace(my_date.getYear()); // output: 99<br />

trace(my_date.getFullYear()); // output: 1999<br />

my_date.setYear(2003);<br />

trace(my_date.getYear()); // output: 103<br />

trace(my_date.getFullYear()); // output: 2003<br />

toString (Date.toString method)<br />

public toString() : String<br />

Returns a string value for the specified date object in a readable format.<br />

Returns<br />

String - A string.<br />

Example<br />

The following example returns the information in the dateOfBirth_date Date object as a<br />

string. The output from the trace statements are in local time <strong>and</strong> vary accordingly. For Pacific<br />

Daylight Time the output is seven hours earlier than universal time: Mon Aug 12 18:15:00<br />

GMT-0700 1974.<br />

Date 331

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

Saved successfully!

Ooh no, something went wrong!