Ver Mensaje Individual
  #11 (permalink)  
Antiguo 06/05/2002, 01:13
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 5 meses
Puntos: 61
Re: Banners aleatorios .swf y .gif

Tienes razón, vamos a modificar un poco el script...

Le vamos a añadir la variable destino para los gifs, y además modificamos un poco lo que escribe en caso de que sea un GIF.

<SCRIPT LANGUAGE="JavaScript">
// Realizado por: Fabian Muller modificado por Carlos de Sagarra (espero que no le importe)
// WebExperto.com - Ayuda al webmaster en español

// Comienzo

var banners = 3;
var ahora = new Date()
var segundos = ahora.getSeconds()
var ad = segundos % banners;
ad +=1;
if (ad==1) {
archivo="banner1"
extension="swf"
width="468";
height="60";
}
if (ad==2) {
archivo="banner2"
extension="gif"
width="468";
height="60";
destino="links/enlaces.html"

}
if (ad==3) {
archivo="banner3"
extension="gif"
width="468";
height="60";
destino="http://www.lokesea.com"

}
document.write("<center>");
if (extension=="swf"){
flash=archivo+"."+extension;
document.write('<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=' + width + ' height=' + height + ' CODEBASE=\"http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0\">');
document.write('<PARAM NAME=\"MOVIE\" VALUE=\"' + flash + '\">');
document.write('<PARAM NAME=\"PLAY\" VALUE=\"true\">');
document.write('<PARAM NAME=\"LOOP\" VALUE=\"true\">');
document.write('<PARAM NAME=\"QUALITY\" VALUE=\"high\">');
document.write('<EMBED SRC=' + flash + ' width=' + width + ' height=' + height + ' PLAY=\"true\" LOOP=\"true\" QUALITY=\"high\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi? P1_Prod_Version=ShockwaveFlash\">');
document.write('</EMBED>');
document.write('</OBJECT>');}
else {document.write('<a href='+destino+'> <img src='+archivo+'.'+extension+' width='+width+' height='+height+'></a> ');
document.write('</center>');}

// Fin
</SCRIPT>

Los cambios están en negrita. El script está entero así que lo puedes copiar de aquí y sustituir el otro. Perdona este fallo, pero es que no suelo hacer banners..
Salu2

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="190" height="51"><param name="bgcolor" value="#0066CC"><param name="movie" value="http://www.webareyou.com/Movie1.swf"><embed src="http://www.webareyou.com/Movie1.swf"></embebed></object>