dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to let dates decide what to show

  1. #1
    flashomaniac
    Join Date
    Aug 2001
    Location
    Denmark
    Posts
    24

    How to let dates decide what to show

    Hi
    Is there a way to use dates to control what animation to show. I want to make a christmas calender for my sister's kids but cant work out how to let the dates decide wich day to open ... hope u understand what i mean ...

    Waark

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    Copenhagen, Denmark
    Posts
    228
    use new Date().getDate(); to return todays date (a number between 1 and 31) - eg.:

    daytoopen = new Date().getDate();

    cheers
    idi

  3. #3
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    code:
    dayToShow=new Date().getDate()
    trace(dayToShow)


    Will return 28. Today is the 28th of November. You can use this to do something like:
    code:
    dayToShow=new Date().getDate()
    loadMovieNum("day"+dayToShow+".swf", 0)


    Which will load an external swf named "day28.swf" onto level 0.
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  4. #4
    flashomaniac
    Join Date
    Aug 2001
    Location
    Denmark
    Posts
    24
    Tak for hjælpen Idi

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Location
    Copenhagen, Denmark
    Posts
    228
    selv tak

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