A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Sreensaver Creation

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    4

    Thumbs up Sreensaver Creation

    Hi all

    I have been asked to create a screensaver that will show a different movie/message all week, then at the end of the week I would need to have it revert back and do the same all over.

    All 7 movies (one for each day of the week) will be located inside the SWF file, I just need to know if it's possible for the movies to change over with the computers time and date.

    Thanks

    Matt

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Sure, just have one main SWF that is loaded at startup and have it check the current date to figure out which of the 7 SWFs to load and display as your screensaver.

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    Thanks for your reply!

    I'm kind of new to the ActionScript side of Flash have you got any suggestions as to the kind of code I should be using?

    Thanks again.

  4. #4
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    I do apologize for my lack of scripting chops, I'm more on the designing side so I panic a little when it comes to this kind of stuff. But would I be on the right track If I began with the following script? I have got the document set up with each days movieclip on its own keyframe (7 in total) but it's just activating that keyframe on the given day that I'm finding difficult to work out. I assume it's a condition followed by a gotoAndPlay command?

    var today_date : Date = new Date();
    var dayOfWeek_array : Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    var day_str : String = dayOfWeek_array[today_date.getDay()];
    Last edited by jetglo; 07-13-2009 at 02:08 PM.

  5. #5
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    There's no need to mess about with strings and the names of the days. I've made a couple of assumptions about how your timeline is set up, but this should be pretty close to what you need...

    Code:
    var today:Date = new Date();
    var n:Number = today.getDay(); // 0=sun, 1=mon, ...
    gotoAndPlay(n+2); // assumes frame 1 is where this code is, frame 2 = sun, ...

  6. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    4

    Talking

    I think that might have cracked it Northcode, I've done a few tests and it appears to working. I'll post any problems if I have any.

    In the meantime a MASSIVE thank you to you sir!

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