Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

animar'z

objetos voando

Recommended Posts

ola eu preciso criar sabem aqueles objetos que ficam voando na tela eu tenho um exemplo mas eu preciso que seja um um flash voando na tela e não um jpg

 

digo um swf voando olha o codigo abaixo

 

:

 

var imagem="Movie1.swf"if (document.layers){document.write("<LAYER NAME='animacao' LEFT=200 TOP=200> <embed name='Movie1' src='++imagem' quality='high' bgcolor='#000066' width='113' height='77' type='application/x-shockwave-flash'></embed></LAYER>")}else if (document.all){document.write("<div id='animacao' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'><img src='"+imagem+"'></div>")} conta=-1;move=1;function curva(){abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)for (i=0; i < abc.length; i++){var C=Math.round(Math.random()*[i])}iniciar=abc[C];setTimeout('curva()',1900);return iniciar;}ypos=10;xpos=10;movimento = 60;function moveR(){caminho=movimento+=iniciar;y = 4*Math.sin(caminho*Math.PI/180);x = 6*Math.cos(caminho*Math.PI/180);if (document.layers){ypos+=y;xpos+=x;document.animacao.top=ypos+window.pageYOffset;document.animacao.left=xpos+window.pageXOffset;}else if (document.all){ypos+=y;xpos+=x;document.all.animacao.style.top=ypos+document.body.scrollTop;document.all.animacao.style.left=xpos+document.body.scrollLeft;}T=setTimeout('moveR()',50);}function edges(){if (document.layers){if (document.animacao.left >= window.innerWidth-40+window.pageXOffset)movimento=Math.round(Math.random()*45+157.5);if (document.animacao.top >= window.innerHeight-30+window.pageYOffset)movimento=Math.round(Math.random()*45-112.5);if (document.animacao.top <= 2+window.pageYOffset) movimento = Math.round(Math.random()*45+67.5);//OK!if (document.animacao.left <= 2+window.pageXOffset) movimento = Math.round(Math.random()*45-22.5);//OK!}else if (document.all){if (document.all.animacao.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)movimento=Math.round(Math.random()*45+157.5);if (document.all.animacao.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)movimento=Math.round(Math.random()*45-112.5);if (document.all.animacao.style.pixelTop <= 2+document.body.scrollTop) movimento = Math.round(Math.random()*45+67.5);//OK!if (document.all.animacao.style.pixelLeft <= 2+document.body.scrollLeft) movimento = Math.round(Math.random()*45-22.5);//OK!}setTimeout('edges()',100);}function efeito(){curva();moveR();// onUnload="opener.gO()"edges();}if (document.all||document.layers)efeito()</script>

 

obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

na layer da netscape você fez "certo" mas na hr de mostrar nos navegadores IE você deixou com a tag <img>

ASP [/tr][tr]<script>

var imagem="Movie1.swf"

 

if (document.layers)

{document.write("<LAYER NAME='animacao' LEFT=200 TOP=200> <embed name='Movie1' src='++imagem' quality='high' bgcolor='#000066' width='113' height='77' type='application/x-shockwave-flash'></embed></LAYER>")

}

 

else if (document.all){document.write("<div id='animacao' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'><embed name='Movie1' src='"+imagem+"' quality='high' bgcolor='#000066' width='113' height='77' type='application/x-shockwave-flash'></embed></div>")

}

 

conta=-1;

move=1;

function curva(){

abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)

for (i=0; i < abc.length; i++)

{var C=Math.round(Math.random()*)}

iniciar=abc[C];

setTimeout('curva()',1900);

return iniciar;

}

ypos=10;

xpos=10;

movimento = 60;

function moveR(){

caminho=movimento+=iniciar;

y = 4*Math.sin(caminho*Math.PI/180);

x = 6*Math.cos(caminho*Math.PI/180);

if (document.layers){

ypos+=y;

xpos+=x;

document.animacao.top=ypos+window.pageYOffset;

document.animacao.left=xpos+window.pageXOffset;

}

else if (document.all){

ypos+=y;

xpos+=x;

document.all.animacao.style.top=ypos+document.body.scrollTop;

document.all.animacao.style.left=xpos+document.body.scrollLeft;

}

T=setTimeout('moveR()',50);

}

function edges(){

if (document.layers){

if (document.animacao.left >= window.innerWidth-40+window.pageXOffset)movimento=Math.round(Math.random()*45+157.5);

if (document.animacao.top >= window.innerHeight-30+window.pageYOffset)movimento=Math.round(Math.random()*45-112.5);

if (document.animacao.top <= 2+window.pageYOffset) movimento = Math.round(Math.random()*45+67.5);//OK!

if (document.animacao.left <= 2+window.pageXOffset) movimento = Math.round(Math.random()*45-22.5);//OK!

}

else if (document.all)

{

if (document.all.animacao.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)movimento=Math.round(Math.random()*45+157.5);

if (document.all.animacao.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)movimento=Math.round(Math.random()*45-112.5);

if (document.all.animacao.style.pixelTop <= 2+document.body.scrollTop) movimento = Math.round(Math.random()*45+67.5);//OK!

if (document.all.animacao.style.pixelLeft <= 2+document.body.scrollLeft) movimento = Math.round(Math.random()*45-22.5);//OK!

}

setTimeout('edges()',100);

}

function efeito(){

curva();

moveR();// onUnload="opener.gO()"

edges();

}

if (document.all||document.layers)

efeito()

</script>

[/tr]

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.