Advanced Search

Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Time controlled pictures..

  1. #11
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    //creates an empty movie clip to save the place for the images that will be loaded
    this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
    var mclListener:Object = new Object();
    mclListener.onLoadInit = function(target_mc:MovieClip) {
    
    //this variable places the image where it needs to be
    var image_mc = image_mc._x = 580;
    };
    var image_mcl:MovieClipLoader = new MovieClipLoader();
    image_mcl.addListener(mclListener);
    	
    var now_date:Date = new Date();
    var currentHour:Number = now_date.getHours();
    // if the current hour is less than 9AM...
    if (currentHour <6 ) {
        trace("MPod");
    	image_mcl.loadClip("imager5.png",image_mc);
    // else..if the current hour is less than 2PM...
    } else if (currentHour < 13) {
        trace("Rooney and Moon in the morning");
       image_mcl.loadClip("image1.png", image_mc);
       // else..if the current hour is less than 2PM...
    } else if (currentHour < 13) {
        trace("Bill");
       image_mcl.loadClip("imager2.png", image_mc);
       // else..if the current hour is less than 7PM...
    } else if (currentHour < 20) {
        trace("Angela");
    	image_mcl.loadClip("image3.png",image_mc);
      // else..if the current hour is less than 9PM...
    } else if (currentHour < 21) {
        trace("Best of Rooney Moon");
         image_mcl.loadClip("image1.png", image_mc);
    	 // else the current hour is between 9PM and 11:59PM
    } else {
        trace("DJ KC");
    	image_mcl.loadClip("image4.png", image_mc);
    }
    
    //dont forget to export images used for actions script on the linking menu (on the library)

    That is my final code.. thank you so much everyone!!
    I couldnt done it without you..


    Nara

    Its on the banner on www.heymix.com the part that says ON AIR NOW.. it changes according to the hr of day!

  2. #12
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm... I was totaly happy about this code until I found out it needs to have a diferent schedules on saturday and sunday..

    would anyone tell me how to implement the getDay(): on the above code??

    Thanks again..

    dgnara

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
  •