A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Got the time? Script for adding a clock to a console...

  1. #1
    Senior Member
    Join Date
    Feb 2001
    Posts
    143

    resolved

    Hey folks. How do I make the time appear on a console in a designated spot? I want there to be no background and if it was possible to also display seconds, that would be awesome.

    J

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Location
    Sydney, Australia
    Posts
    271
    Jason me again.

    do you know how to use the date object? probably the best way to handle that is to have some sort of two frame loop that creates a new date object and then a text box that displays it. you can set the text box to have no border or background easily enough then it's just a matter of getting the date object into a meaningfull format that you can display. Shouldn't be too hard.

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Posts
    143

    resolved Hey D.M.

    I'm actually clueless here. Would you be willing to explain it in more detail? T'would be much appreciated.

    J

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Location
    Sydney, Australia
    Posts
    271
    Alright.

    first thing is to set up a two frame loop. On frame two have this comand:
    gotoAndPlay(1);

    this will cause the movie to loop over two frames. Then you have to set up a variable for your date object, something like this:

    myDate = new Date(); /*this should be on frame one*/
    myTimeDisplay = myDate.getHours() + ":" + myDate.getMinutes() + ":" myDate.getSeconds(); /*this will give you the hours, minutes and seconds of the time according to the operating system that the flash player is running on*/

    Then all you need is a text box that has myTimeDisplay as the variable. That should work ok, let me know. The text box should span both frame one and two.


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