|
|
|
|
Configuration: Windows XP Internet Explorer 7.0
automatique : ca s'est propriété du swf
aléatoire : javascript je pense, regarde du coté des images aléatoires |
Bonjour,
je cherche également à produite ce même effet d'animation flash aléatoire. As tu trouvé une solution ? Merci de ta réponse. Myrtie. Configuration: Windows XP Firefox 2.0.0.6 |
Bonjour,
Il fut un temps où j'avais trouvé ceci qui fontionne très bien avec les .swf : function banniere() { numimage= Math.round(Math.random()*(nbimage-1)+1); if (numimage <= 10) {width = 600; height = 120; url = "repertoire/anim.swf";} if (numimage > 10 && numimage <= 20) {width = 655; height = 120; url = "repertoire/anim2.swf";} if (numimage > 20 && numimage <= 30) {width = 655; height = 120; url = "repertoire/anim3.swf";} document.write('<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width=' + width + ' height=' + height + '>') document.write('<param name="movie" value="%27%20%2B%20url%20%2B%20%27">') document.write('<param name="menu" value="false">') document.write('<param name="quality" value="high">') document.write('<param name="LOOP" value="false">') document.write('<embed src="%27%20%2B%20url%20%2B%20%27" quality="high" loop="false" width=' + width + ' height=' + height + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>') document.write('</object>') } Et puis ajouter ceci dans le body à l'endroit voulu : <script language="JavaScript">banniere();</script> |
Merci de ta réponse.
Je viens juste d'essayer. Mais cela ne marche pas du tout chez moi. Aucune animation ne s'affiche. En faite, je veus juste alterner deux animations flash à chaque réactualisation du navigateur. Configuration: Windows XP Firefox 2.0.0.6 |
Tu as bien pensé à changer le nom des fichiers voulu :
url = "repertoire/anim.swf";} Si tu n'as que deux animations, il faut supprimer la dernière : if (numimage > 20 && numimage <= 30) {width = 655; height = 120; url = "repertoire/anim3.swf";} |
Oui, oui, j'ai bien changé les urls et ajouté ton code...
J'ai aussi supprimé la reférence à l'animation 3... rien :-( Voici le code ajouté dans une page : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Document sans nom</title> <script language="JavaScript" type="text/javascript"> function banniere() { numimage= Math.round(Math.random()*(nbimage-1)+1); if (numimage <= 10) {width = 800; height = 520; url = "images/printemps.swf";} if (numimage > 10 && numimage <= 20) {width = 800; height = 520; url = "images/news.swf";} document.write('<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width=' + width + ' height=' + height + '>') document.write('<param name="movie" value="%27%20%2B%20url%20%2B%20%27">') document.write('<param name="menu" value="false">') document.write('<param name="quality" value="high">') document.write('<param name="LOOP" value="false">') document.write('<embed src="%27%20%2B%20url%20%2B%20%27" quality="high" loop="false" width=' + width + ' height=' + height + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>') document.write('</object>') } </script> </head> <body> <script language="JavaScript">banniere();</script> </body> </html> Configuration: Windows XP Firefox 2.0.0.6 |
C'est un peu tard mais cela pourra peut être aider d'autres personnes :
<? $nbimages=4; //mettre le nombre d'image $nomimages[1]="animation01.swf"; // votre swf, attention s'ils ne sont pas dans le même dossier, rajouter le -> mon_dossier/animation01.swf ----- $nomimages[1]="animation02.swf"; $nomimages[1]="animation03.swf"; $nomimages[1]="animation04.swf"; srand((double)microtime()*1000000); $affimage=rand(1,$nbimages); echo("<object type='application/x-shockwave-flash' data=http://ton_site/repértoire_ou_tu_ranges tes swf/".$nomimages[$affimage]." width='xxx' height='xxx'><param name='movie' value=http://ton_site/repértoire_ou_tu_ranges tes swf/".$nomimages[$affimage]."><param name='WMode' value='Transparent'></object>"); ?> Ca marche sur IE et firefox :-)) |
oops,
c'est $nomimages[1]="animation01.swf"; $nomimages[2]="animation02.swf"; $nomimages[3]="animation03.swf"; $nomimages[4]="animation04.swf"; |
Résultats pour page html aléatoire
Résultats pour page html aléatoire
Résultats pour page html aléatoire
Résultats pour page html aléatoire
Résultats pour page html aléatoire