dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Internal Clock Script?

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    1

    Internal Clock Script?

    Hi, I was just wondering if there was a script function I could use to call upon the internal clock of the computer running the animation.
    I'm making a screensaver, and I want the color of the sky to change depending on what time the user's internal clock is set at.

    So, is there?

  2. #2
    Member
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    76
    Hi,

    you can use the Date class of flash:

    Code:
    var d = new Date;
    d.getTime();
    You have to call the getTime() function on every frame because the time in the Date object doesn't change while the real time passes.

    To access the time values, you can use the following functions:
    Code:
    d.getSeconds();
    d.getMinutes();
    d.getHours();
    There's more information about the Date class in the 3DFA syntax helper or here:
    http://livedocs.adobe.com/flash/9.0/...efV3/Date.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center