A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: timed animations

  1. #1
    Junior Member
    Join Date
    Sep 2002
    Posts
    23

    timed animations

    How can I use actionscript to load movies on a time basis? - a ball rolls across the screen after 2 minutes, after 2.5 minutes a balloon floats up the side. etc.

    thanks,

    Powersolo
    thanks a million!

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,
    This will load a picture based on time of day, but it could easily be adapted to load a swf.
    Something like this........

    code:

    now = new Date();
    hour = now.getHours();
    trace(hour);
    if (hour>7 && hour<12) {
    _root.attachMovie("sunrise.jpg", "Morning",10);
    } else if (hour>12 && hour<18) {
    _root.attachMovie("midday.jpg", "day",10);
    } else if (hour>18 && hour<24) {
    _root.attachMovie("evening.jpg", "Evening",10);
    loadMovieNum("evening.jpg", 10);
    } else if (hour>0 && hour<7) {
    _root.attachMovie("latenight.jpg", "Dark",10);
    }




    HTH
    NTD

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