SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Countdown

  1. #1
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Countdown

    Hey Everyone,

    Can anyone show me how to make a countdown in days, hours, minutes and seconds until a certain day starting from a specified date and time? Only thing is it has to be with Flash 5, that's all I've got

    Thanks for any help

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well make a blank mc on the stage and put a dynamic textbox in it with a variable name of myDate. Then attach the following clip events to the instance of the clip on the main stage.

    Code:
    onClipEvent(load) {
     dateObj = new Date(2003,5,30,14,30,00);
    }
    onClipEvent(enterFrame) {
     var curDate = new Date();
     diff = Math.ceil((dateObj.getTime() - curDate.getTime()) / 1000);
     numdays = Math.floor(diff/86400);
     numhours = Math.floor((diff/3600)%24);
     nummin = Math.floor((diff/60)%60);
     numsec = Math.floor(diff%60);
     myDate = numdays + " days " + numhours + " hours " + nummin + " minutes " + numsec + " seconds";
    }

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Louie, I'll give it a try

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


Bookmarks

Posting Permissions

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