Detailed instructions for use are in the User's Guide.
[. . . ] Flash Lite 2. x ActionScript Language Reference
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Endocer, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Adobe Systems Incorporated and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Adobe Systems Incorporated or other entities and may be registered in certain jurisdictions including internationally. Third-Party Information This guide contains links to third-party websites that are not under the control of Adobe Systems Incorporated, and Adobe Systems Incorporated is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. [. . . ] If you omit this parameter, the date field of the specified Date object will not be modified. Returns
date:Number
Number
- An integer.
Example The following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date. setFullYear() to change the date to May 15, 2002:
var my_date:Date = new Date(2004, 4, 15); trace(my_date. getFullYear()); //output: 2004 my_date. setFullYear(2002); trace(my_date. getFullYear()); //output: 2002
See also
getUTCDay (Date. getUTCDay method), getDay (Date. getDay method)
Date
345
setHours (Date. setHours method)
public setHours(hour:Number) : Number
Sets the hours for the specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
hour:Number
- An integer from 0 (midnight) to 23 (11 p. m. ).
Returns
Number
- An integer.
Example The following example initially creates a new Date object, setting the time and date to 8:00 a. m. on May 15, 2004, and uses Date. setHours() to change the time to 4:00 p. m. :
var my_date:Date = new Date(2004, 4, 15, 8); trace(my_date. getHours()); // output: 8 my_date. setHours(16); trace(my_date. getHours()); // output: 16
setMilliseconds (Date. setMilliseconds method)
public setMilliseconds(millisecond:Number) : Number
Sets the milliseconds for the specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
millisecond:Number
- An integer from 0 to 999.
Returns
Number
- An integer.
346
ActionScript classes
Example The following example initially creates a new Date object, setting the date to 8:30 a. m. on May 15, 2004 with the milliseconds value set to 250, and then uses Date. setMilliseconds() to change the milliseconds value to 575:
var my_date:Date = new Date(2004, 4, 15, 8, 30, 0, 250); trace(my_date. getMilliseconds()); // output: 250 my_date. setMilliseconds(575); trace(my_date. getMilliseconds()); // output: 575
setMinutes (Date. setMinutes method)
public setMinutes(minute:Number) : Number
Sets the minutes for a specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
minute:Number
- An integer from 0 to 59.
Returns
Number
- An integer.
Example The following example initially creates a new Date object, setting the time and date to 8:00 a. m. on May 15, 2004, and then uses Date. setMinutes() to change the time to 8:30 a. m. :
var my_date:Date = new Date(2004, 4, 15, 8, 0); trace(my_date. getMinutes()); // output: 0 my_date. setMinutes(30); trace(my_date. getMinutes()); // output: 30
setMonth (Date. setMonth method)
public setMonth(month:Number, [date:Number]) : Number
Sets the month for the specified Date object in local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running. Availability: ActionScript 1. 0; Flash Lite 2. 0
Date
347
Parameters
month:Number
- An integer from 0 (January) to 11 (December).
date:Number [optional] - An integer from 1 to 31. If you omit this parameter, the date field of the specified Date object will not be modified.
Returns
Number
- An integer.
Example The following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date. setMonth() to change the date to June 15, 2004:
var my_date:Date = new Date(2004, 4, 15); trace(my_date. getMonth()); //output: 4 my_date. setMonth(5); trace(my_date. getMonth()); //output: 5
setSeconds (Date. setSeconds method)
public setSeconds(second:Number) : Number
Sets the seconds for the specified Date object in local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
second:Number
- An integer from 0 to 59.
Returns
Number
- An integer.
Example The following example initially creates a new Date object, setting the time and date to 8:00:00 a. m. on May 15, 2004, and uses Date. setSeconds() to change the time to 8:00:45 a. m. :
var my_date:Date = new Date(2004, 4, 15, 8, 0, 0); trace(my_date. getSeconds()); // output: 0 my_date. setSeconds(45); trace(my_date. getSeconds()); // output: 45
348
ActionScript classes
setTime (Date. setTime method)
public setTime(millisecond:Number) : Number
Sets the date for the specified Date object in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
millisecond:Number
- A number; an integer value where 0 is midnight on January 1,
universal time. Returns
Number
- An integer.
Example The following example initially creates a new Date object, setting the time and date to 8:00 a. m. on May 15, 2004, and uses Date. setTime() to change the time to 8:30 a. m. :
var my_date:Date = new Date(2004, 4, 15, 8, 0, 0); var myDate_num:Number = my_date. getTime(); // convert my_date to milliseconds myDate_num += 30 * 60 * 1000; // add 30 minutes in milliseconds my_date. setTime(myDate_num); // set my_date Date object 30 minutes forward trace(my_date. getFullYear()); // output: 2004 trace(my_date. getMonth()); // output: 4 trace(my_date. getDate()); // output: 15 trace(my_date. getHours()); // output: 8 trace(my_date. getMinutes()); // output: 30
setUTCDate (Date. setUTCDate method)
public setUTCDate(date:Number) : Number
Sets the date for the specified Date object in universal time and returns the new time in milliseconds. Calling this method does not modify the other fields of the specified Date object, but Date. getUTCDay() and Date. getDay() can report a new value if the day of the week changes as a result of calling this method. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters
date:Number
- A number; an integer from 1 to 31.
Date
349
Returns
Number
- An integer.
Example The following example initially creates a new Date object with today's date, uses Date. setUTCDate() to change the date value to 10, and changes it again to 25:
var my_date:Date = new Date(); my_date. setUTCDate(10); trace(my_date. getUTCDate()); // output: 10 my_date. setUTCDate(25); trace(my_date. getUTCDate()); // output: 25
See also
getUTCDay (Date. getUTCDay method), getDay (Date. getDay method)
setUTCFullYear (Date. setUTCFullYear method)
public setUTCFullYear(year:Number, [month:Number], [date:Number]) : Number
Sets the year for the specified Date object (my_date) in universal time and returns the new time in milliseconds. [. . . ] substring(string:String, index:Number, count:Number)String tellTarget(target:String, statement(s)) toggleHighQuality() Deprecated since Flash Player 5. This function was deprecated in favor of String. substr(). Macromedia recommends that you use dot (. ) notation and the with statement. This function was deprecated in favor of _quality.
762
Deprecated ActionScript
Deprecated Property summary
Modifiers Property Name
Button. _highquality
Description
Deprecated since Flash Player 7. [. . . ]