A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Ad rotator

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    5

    Lightbulb

    Does anyone know of code or have it to have a banner rotator that can load .swfs?

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Like a script on a page to rotate small banner adds or a large E-paper Banner rotater?

  3. #3
    Junior Member
    Join Date
    Nov 2000
    Posts
    5
    Originally posted by johnie
    Like a script on a page to rotate small banner adds or a large E-paper Banner rotater?
    ya like 120x60 and the like...
    not just animated gifs but .swfs as well

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    I have a script sorta of what you want and will post it here:

    Code:
    <HTML> 
    <HEAD> 
    <TITLE>random SWF</TITLE> 
    
    <SCRIPT LANGUAGE="JavaScript"> 
    
    var r1=1 
    var r2=3 
    
    function Randomise(r1, r2) { 
    if (r2 > r1) return (Math.round(Math.random()*(r2-r1))+r1); 
    else return (Math.round(Math.random()*(r1-r2))+r2); 
    } 
    function MakeArray(size) { 
    this.length = size; 
    for(var g = 1; g <=size; g++); 
    { 
    this[g] = 0; 
    } 
    return this; 
    } 
    
    
    
    function getSwish() { 
    swishArray = new MakeArray(3); 
    swishArray[1] = "mov1.swf"; 
    swishArray[2] = "mov2.swf"; 
    swishArray[3] = "mov3.swf"; 
    
    randSwish = swishArray[Randomise(r1,r2)]; 
    return randSwish; 
    } 
    
    function drawme() { 
    document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' "); 
    document.writeln(" codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0' "); 
    document.writeln(" ID=Untitled WIDTH=400 HEIGHT=250> "); 
    document.writeln(" <PARAM NAME=movie VALUE="+getSwish()+"> "); 
    document.writeln(" <PARAM NAME=loop VALUE=false> "); 
    document.writeln(" <PARAM NAME=menu VALUE=false> "); 
    document.writeln(" <PARAM NAME=quality VALUE=high> "); 
    document.writeln(" <PARAM NAME=bgcolor VALUE=#009900> "); 
    document.writeln(' <PARAM NAME="loop" value="true"> '); 
    document.writeln( "</OBJECT></center>"); 
    } 
    
    
    </SCRIPT> 
    </HEAD> 
    
    <BODY BGCOLOR="#009900"> 
    <script> 
    window.onLoad=drawme() 
    </script> 
    </body> 
    </HTML>
    you will need to adjust the height and width and add a timer. in the body to call the SWF. Remember also that a SWF object is still an object on a web page and is subject to javascript control and manipulation. What you are interested in here is the drawme function. You can put your add in a frame and call drawme in the frame set on a timer. Do this and you have a random SWF, banner displayed on a page on a timer.

    Perhaps I may make this for you if I get the time.

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Posts
    5
    Thanks.. it looks a littl ecomplicated but.. if you can help me put a timer that would be awesome!

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