peguei um script e adaptei pra poder rodar flash ou imagem no slide...
nao sei se o que adaptei esta certo, mas esta funcionando
porem, ele nao roda se alguma imagem do site estiver com caminho errado
ex:
tenho o slide numa div e se alguma imagem que vier no rodape estiver "queimada" o slide nao funciona
queria saber se é o script que esta errado e gostaria de usar sem precisar por <body onload="slide.start()"> é possivel?
valeu galera
<script>
slide = {
//vetor com os slides
_imagens : [
["img/publicidade_02.swf","1","_self","1.htm","f"],
["img/2.gif","2","_blank","2","i"],
["img/04.jpg","3","_self","3","i"],
["img/05.jpg","4","_self","4","i"]
],
// variáveis do sistema
_count : 0,
_length : null,
_timeOutID : null,
_pause : false,
_timer : 5,
// função que inicia o slide e seta todas os parâmetros necessários
start : function(){
with(this){ _preLoader(); _length = _imagens.length; _work(); }
},
// faz o pré-carregamento das imagens
_preLoader : function(){
for(x in this._imagens){
var image = new Image();
image.src = this._imagens[x][0];
}
},
// função principal que faz as checagens necessárias
_work : function(){
with(this){
(_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0);
var current = _imagens[_count];
_exchange(current);
if(!_pause){
(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0);
_timeOutID = setTimeout(function(){ slide.next(); }, (Number(_timer)*1000));
}
}
},
// função que altera os elementos da página, altere os IDs se necessário
_exchange : function(img){
altura = '120';
largura = '235';
if (img[4]=="f")
{
propagandaFlash = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="z-index:9997" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="235" height="120" id="dhtmlig" ALIGN="">';
propagandaFlash += '<PARAM NAME="movie" value="'+img[0]+'">';
propagandaFlash += '<PARAM NAME="quality" VALUE="high">';
propagandaFlash += '<PARAM NAME="wmode" VALUE="transparent">';
propagandaFlash += '<PARAM NAME="bgcolor" VALUE="#FFFFFF">';
propagandaFlash += '<EMBED style="z-index:9997" src="'+img[0]+'" quality="high" wmode="transparent" bgcolor="#FFFFFF" width="'+largura+'" height="'+altura+'" NAME="dhtmlig" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
propagandaFlash += '</OBJECT>';
//propagandaFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="235" height="120" id="img/publicidade_02" align="middle">';
//propagandaFlash += '<param name="allowScriptAccess" value="sameDomain" />';
//propagandaFlash += '<param name="movie" value="'+img[0]+'" />';
//propagandaFlash += '<param name="quality" value="high" />';
//propagandaFlash += '<param name="bgcolor" value="#ffffff" />';
//propagandaFlash += '<embed src="'+img[1]+'" quality="high" bgcolor="#ffffff" width="243" height="120" name="img/publicidade_02" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
//propagandaFlash += '</object>';
document.getElementById("linkfoto").innerHTML = propagandaFlash
document.getElementById("linkSlide").innerHTML = img[1];
}
else
{
document.getElementById("linkfoto").target = img[2];
document.getElementById("linkfoto").href = img[3];
document.getElementById("linkfoto").innerHTML = '<img src="'+img[0]+'" width="'+largura+'" height="'+altura+'" />';
document.getElementById("linkSlide").innerHTML = img[1];
document.getElementById("linkSlide").target = img[2];
document.getElementById("linkSlide").href = img[3];
}
},
// altera para o próximo slide ao clicar no botão Próximo
next : function(){
with(this){ _count++; _work(); }
},
// altera para o slide anterior ao clicar no botão correspondente
previous : function(){
with(this){ _count--; _work(); }
},
// controla o tempo de troca de cada slide
tControl : function(act){
with(this){
(act=="m")?((_timer==4)?void(0):_timer=_timer-1):((_timer==9)?void(0):_timer= _timer +1);
document.getElementById('showTimer').innerHTML = _timer+"s";
}
}
}
</script>
Edição feita por: leanjo, 14/05/2007, 03:30.











