Web Analytics Made Easy -
StatCounter Banner rotation with flash based on time.. - CodingForum

Announcement

Collapse
No announcement yet.

Banner rotation with flash based on time..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Banner rotation with flash based on time..

    Hello everyone,

    I need some help on this...

    Basically I created a script which changes image banner on site depending on which day it is, and what period of time it is.

    Script goes like this:

    HTML part


    Code:
    <img id="banner" />

    Javascript code


    Code:
    var nowHr=new Date().getHours();
    var nowMin = new Date().getMinutes();
    var bannerImg = document.getElementById("banner");
    var nowMilTime = (nowHr*100)+nowMin;
    
    var today=new Date()
    nowDate=today.getDay()
    
    
    if (nowDate==1 && nowMilTime >= 800 && nowMilTime < 1000)
    {bannerImg.src="images/main_banner/1.jpg";}
    
    if (nowDate==1 && nowMilTime >= 1000 && nowMilTime < 1200)
    {bannerImg.src="images/main_banner/2.jpg";}
    
    else
    {bannerImg.src="images/main_banner/3.jpg";}


    So this works great, if you need script for that here you go... ))


    Now, WHAT I NEED NOW is instead o using images (1.jpg, 2.jpg...) I want to use Flash (1.swf, 2.swf...).

    So is it possible to modify this script and make it work with Flash?


    THANKS!!
    Last edited by GuitarLord; Apr 11, 2009, 03:42 AM.

  • #2
    Originally posted by GuitarLord View Post
    So is it possible to modify this script and make it work with Flash?
    In a word, no.

    Have a look at:-

    http://www.hotscripts.com/listing/fl...anner-rotator/

    http://www.flash-banner-creator.com/...r_rotator.html

    Quizmaster: According to legend, who shot an apple off the top of his son's head?
    Contestant: Was it Isaac Newton?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment

    Working...
    X