-
Does anyone know of code or have it to have a banner rotator that can load .swfs?
-
Like a script on a page to rotate small banner adds or a large E-paper Banner rotater?
-
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
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|