View Full Version : Random banners help

07-18-2007, 04:50 PM
hi there, I'm fairly new to Dreamweaver just learning as I go but I'm stuck now. I've been asked to put advertising banners on a site which, when you reload or refresh the page, they randomly change.
I've seen bits of script that will do this but my scripting skills aren't the best and I could do with a more broken down step by step guide.
can anyone help at all?

07-18-2007, 05:13 PM
Are you going to manage these banners in a db?
If so you might use PHP to randomly display a banner, If not might as well just use JS to select from a list of images.

07-18-2007, 10:15 PM
cerpnjak you could use flash. This is what i would use.

07-19-2007, 08:21 AM
I probably could use Flash but not brilliant with it. Basically on the site are a number of sponsors all who can have these advertising banners, what I want to do is to be able to put the banners in a folder and then use some sort of script to tell DW to go in a pick randomly from whatevers in the folder.
Can this be done? I'm sure I've seen script that can do it, only thing is I'm not entirely sure how to implement it. So if anyone knows of any script I would be most appreciative if they could post it up and also give me a brief rundown of how to use it]
Many thanks

07-19-2007, 09:02 AM
yes it can be done using Javascript

i think i have written one or two in my time

i will dig one out for you

07-19-2007, 10:32 AM
I will also dig out the flash code as well as i have done this before on promotional cd-roms.

So you have the best of both worlds.

07-19-2007, 10:36 AM
Thanks guys it's much appreciated

07-19-2007, 09:38 PM
You then need to add a layer at the top a flash movie which is going to be the place holder and you use the following code:-

pic = random(3)+1;
loadMovie("pic"+pic+".jpg", _root.here);

You need to place the images in the same folder locations and then name them say "pic"

From example


Hope this helps.....

07-20-2007, 01:36 AM
heres a tutorial if your still stuck