Développement web indépendant à Montpellier

Publié le dimanche 22 mars 2009 08:35:43

Intégration d'animations flash : SwfObjet, Embed, Object

Quelle méthode d'intégration choisir : en effet, il existe diverses méthodes pour intégrer du contenu flash dans les pages , elles ont toutes leurs avantages et leurs inconvénients : cet article se propose d'en fait la synthèse.

La méthode classique, utilisant la balise

L'intégration préconisée par le est simple, la balise object est recommandée. Je précise que la balise embed est dépréciée.

<!--début de l'animation Flash-->
<object type="application/x-shockwave-flash" data="animation.swf" width="200" height="200">
        <param name="movie" value="animation.swf" />
        <!--début de l'alternative-->
        <p>Alternative de l'animation</p>
        <!-- fin de l'alternative-->
<!--fin de l'animation Flash-->

C'est très simple, et cela permet de rester valide aux normes . Le code généré par certains logiciel est très verbeux, et à plus de la moitié inutile.

Une méthode alternative : SwfObject

C'est la méthode que nous avons choisi pour afficher le bandeau Flash de notre page d'accueil. Elle inclue un petit script Javascript à télécharger sur la page de l'éditeur : voir le site du projet SwfObject.

L'intégration se fait de la manière suivante avec la dernière version de SwfObject :

Inclusion du script :

<script type="text/javascript" src="swfobject.js"></script>

On place un calque qui va accueillir l'animation :

<div id="animation"></div>

Ensuite on fait l'appel au script SwfObject, il faut que le calque "animation" soit chargé, c'est à dire que :

  • soit il faut placer le code Javascript en dessous de l'élément dans lequel on va charger le flash,
  • soit on fait cet appel dans le body.onload.

(Les 2 façons de faire trouvent leur justification au niveau de l'architecture globale de l'application web).

Appel de SWFObject

 //les variables à passer à l'animation   
var flashvars={url:"datas/datas.xml"};
//ici la liste des paramètres
var params={menu:"false"};
//ici l'identifiant de l'élément Object
var attributes={id:"swf_banniere",name:"swf_banniere"};

Il est à noter que si vous utilisez l'ancienne version d'SwfObject, le code généré contient la balise embed dépréciée. Que le soit généré ou non par Javascript, votre code n'est donc dans ce cas plus valide, même s'il passe au validateur. (c'est un peu tatillon cela dit, puisque d'un point de vue utilisateur, rien ne change ).

Quelle est la meilleur méthode ?

Les deux mon colonel ! disons plutôt que je n'ai pas d'opinion à ce sujet, voici les avantages et inconvénients de chacune :

Avantages/Inconvénients de la classique :

  • plus légère, pas d'inclusion de Javascript (pas besoin non plus de support Javascript),
  • pas du gestion du Flash, en cas d'absence, l'alternative s'affiche, et c'est tout.

Avantages et inconvénients de l'inclusion SwfObject :

  • Gestion du
  • on affiche pas l'animation sans Javascript.

Notez cet article !

  • Actuellement 0 sur 5 étoiles
  • 1
  • 2
  • 3
  • 4
  • 5

Note : 0/5 (0 notes attribuées)

Merci d'avoir participé !

Vous avez déjà noté cette page, vous ne pouvez la noter qu'une fois !

Votre note a été changée, merci de votre participation !

Bonne résolution ! j'arrête d'alourdir mes pages avec des boutons de partage, mais vous pouvez continuer de partager :-)


  1. ayuda con... | ayuda con solución de caso |

    Really i appreciate the effort you made to share the knowledge. This is really a great stuff for sharing. Keep it up . Thanks for sharing.

  2. http://vi... | http://vitalhealthrecipes.com/lexapro-uses-dosage-and-side-effects/ |

    that is a great submit. i love this topic.This site has plenty of benefit.i discovered many exciting things from this website. It facilitates me in lots of ways.thanks for posting this once more.

  3. by visiting this site I found cool stuff here keep it up.

  4. i'm satisfied i found this web web site, I couldn't discover any expertise in this matter previous to.also function a domain and in case you are ever inquisitive about doing a little visitor writing for me if viable sense loose to permit me know, im always look for people to test out my internet web site.

  5. This is really an incredible read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome!.

  6. You make such a large number of awesome focuses here that I read your article two or three times. Your perspectives are as per my own generally. This is incredible substance for your perusers.

  7. https://d... | https://discoup.enable-javascript.com/ |

    wonderful article, thank you for placing this collectively! this is glaringly one notable submit. thank you for the valuable information and insights you've got so supplied right here.

  8. I gotta most loved this site it appears to be exceptionally useful .

  9. industria... | industrial cleaning services melbourne |

    This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it

  10. Nigeria c... | Nigeria custom import duty tariff |

    this is this kind of incredible aid which you are providing and you provide it away without spending a dime. i love seeing websites that apprehend the price of providing a nice aid without spending a dime. it is the vintage what goes around comes round habitual.

  11. elegent a... | elegent and stylish all over print tote bags |

    we are an online store and a new brand that design and sell unique and beautifully designed all-over printed tote bags.

  12. Wow what a Great Information about World Day its exceptionally decent educational post. a debt of gratitude is in order for the post.

  13. junkbgone... | junkbgone furniture removal fairfax va |

    junkbgone furniture removal fairfax va

  14. Raid Data... | Raid Data Recovery specialists cape town |

    Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post!

  15. Fabulous web journal! Do you have any tips and indications for trying authors? I'm wanting to begin my own particular site soon however I'm somewhat lost on everything. Would you propose beginning with a free stage like WordPress or go for a paid alternative? There are such a large number of alternatives out there that I'm totally overpowered .. Any proposals? Much obliged!

  16. I was looking at some of your posts on this website and I conceive this web site is really instructive! Keep putting up..

  17. A debt of gratitude is in order for sharing the information, keep doing awesome... I truly delighted in investigating your site. great asset...

  18. thanks once more for all of the expertise you distribute,right put up. i was very inquisitive about the object, it is quite inspiring I must admit. i love travelling you site since I constantly come upon thrilling articles like this one.top notch task, I greatly admire that.Do hold sharing! Regards,

  19. Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.

  20. UK mortgage advice ebiste, cvering England, Wales and Scotland for bad credit mortgage advice, people with a current or previous IVA or bankruptcy or just a low credit score

  21. I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. professionals. I thank you to help making people more aware of possible issues.

  22. To start with You got an incredible blog .I will be keen on more comparable themes. i see you got truly extremely valuable points , i will be continually checking your blog much obliged.

  23. I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject?

  24. morocco s... | morocco sahara desert tours |

    Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing.

  25. Epoxy flo... | Epoxy floor contractor Portland |

    I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight.

  26. Your article has aroused a ton of positive hobby. I can see why since you have made such a decent showing of making it fascinating.

  27. https: w... | https: www.miamitokeywesttoursguides.com key west florida trips |

    The marker denotes that it is technically the southernmost point of the continental part of the US.

  28. Undoubtedly this is a phenomenal post I got a considerable measure of learning subsequent to perusing good fortunes. Subject of online journal is astounding there is just about everything to peruse, Brilliant post.

  29. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post!

  30. If you don't mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries.

  31. mahipk | kentucky business broker |

    Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks

  32. personali... | personalised phone case iphone 7 |

    I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.

  33. This is a well written article on this subject. I have been looking at starting a new business and this is valuable information to help me in my decision.<a href="http://...gt;voyance par telephone</a>

  34. I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post.

  35. Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share.

  36. Congrats for making it effectively! you are presently enjoying the product of your hard works and works of your concentration and commitments.

  37. Wow what a Great Information about World Day its extremely decent educational post. much obliged for the post.

  38. hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back.

  39. Best wedd... | Best wedding photographer in chandigarh |

    Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well i really get amazed to read this. Its really good.

  40. I've been surfing online over three hours today, yet I never discovered any fascinating article like yours. It's really sufficiently worth for me. As I would like to think, if all website admins and bloggers made great substance as you did, the web will be significantly more valuable than any other time in recent memory. An entrancing dialog is worth remark. I believe that it is best to compose additional on this matter, it won't be an unthinkable point however by and large individuals are insufficient to chat on such themes. To the following. Here's to you This is a really decent site post. Not very numerous individuals would really, the way you simply did. I am truly inspired that there is such a great amount of data about this subject have been revealed and you've put forth a valiant effort, with so much class. On the off chance that needed to know more about green smoke surveys, than by all methods come in and check our stuff. Thankyou for this wondrous post, I am happy I watched this site on hurray.

  41. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention.

  42. Cool website buddy I am gona suggest this to all my list of contacts.

  43. I recently noticed your website back i are generally looking through which on a daily basis. You’ve got a loads of information at this site so i actually like your look to the web a tad too. Maintain the best show results!

  44. Much obliged to you for setting aside an ideal opportunity to distribute this data exceptionally valuable!

  45. how to st... | how to start Importation Business in Nigeria |

    Truly an incredible expansion. I have perused this superb post. A debt of gratitude is in order for sharing data about it. I truly like that. Much obliged so parcel for your meet.

  46. I like this post,And I figure that they having a great time to peruse this post,they might take a decent site to make an information,thanks for sharing it to me.

  47. Much obliged to you for setting aside an ideal opportunity to distribute this data extremely valuable!

  48. transit v... | transit van welfare unit |

    Exceptionally decent article, I appreciated perusing your post, extremely pleasant offer, I need to twit this to my adherents. Much appreciated!.

  49. I truly welcome this magnificent post that you have accommodated us. I guarantee this would be helpful for the majority of the general population.

  50. Much thanks for this incredible post.

  51. Thank you for your work on the blog! You're doing a good job!

  52. Nice post mate, keep up the great work, just shared this with my friendz

  53. Hi there! Nice post! Please tell us when I will see a follow up!

  54. Extraordinary post, you have brought up some magnificent focuses, I also trust this is an extremely heavenly site.

  55. designer... | designer women handbags |

    I am glad to locate your recognized method for composing the post. Presently you make it simple for me to comprehend and execute the idea. Much obliged to you for the post.
    Fascinating and stunning how your post is! It Is Useful and accommodating for me That I like it all that much, and I am anticipating Hearing from your next..

  56. designer... | designer women handbags |

    I am glad to locate your recognized method for composing the post. Presently you make it simple for me to comprehend and execute the idea. Much obliged to you for the post. Fascinating and stunning how your post is! It Is Useful and accommodating for me That I like it all that much, and I am anticipating Hearing from your next.. A debt of gratitude is in order for sharing this data. I truly like your blog entry all that much. You have truly shared a useful and intriguing blog entry with individuals..

  57. Really great post. I think it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. thanks for sharing

  58. The time which was wasted in traveling for tuition now it can be used for studies.Thanks

  59. Si vous avez inclus les vidéos que vous ne voulez pas être dans la galerie du site Web, vous pouvez facilement les enlever. Sélectionner l'ensemble des vidéos que vous souhaitez supprimer de la galerie du site Web, et sélectionnez bouton de la barre d'outils. Vous pouvez choisir les vidéos en maintenant la touche CTRL tout en cliquant sur les vidéos que vous le souhaitez.

  60. Yes i am completely concurred with this article and i simply need say this article is extremely decent and exceptionally useful article.I will make a point to be perusing your blog more. You made a decent point yet I can't resist the urge to ponder, shouldn't something be said about the other side? !!!!!!THANKS!!!!!! <a href='https://www.google.com/' target='_blank'>google</a>

  61. Hello. I have flash version 18,0,0,209 installed on ym computer. When I try and upload a flash file via html editor it works (is visible once saved) in I.E. 11, but when I use chrome, or firefox the flash doesnt load. The rest of the page loads normally, i put the cursor over where the video should be and right click and all it says is, "Movie not loaded...". Any idea as to what might be going on here?

  62. دانلود قس... | دانلود قسمت 14 عاشقانه |

    دانلود قسمت 14 چهاردهم سریال عاشقانه با لینک مستقیم, دانلود رایگان سریال عاشقانه, دانلود سریال جدید عاشقانه ایرانی دانلود سریال عاشقانه با لینک مستقیم, دانلود فیلم های جدید و برتر, دانلود رایگان فیلم و سریال با لینک مستقیم

  63. This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here!

  64. Mobile Le... | Mobile Legends 5v5 MOBA Hack |

    You make such a variety of extraordinary focuses here that I read your article a few times. Your perspectives are as per my own particular generally. This is incredible substance for your perusers.

  65. Looking f... | Looking for local online marketing? Check out Marketing1on1.com |

    You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. I agree with your way of thinking. Thank you for sharing.

  66. Marvelous and fascinating article. Incredible things you've generally imparted to us. Much obliged. Simply keep making this kind out of post.

  67. A debt of gratitude is in order for sharing this helpful information..

  68. subscript... | subscription boxes for women |

    That is the phenomenal mentality, in any case is simply not make each sence at all proclaiming about that mather. For all intents and purposes any strategy an abundance of thanks notwithstanding i had attempt to advance your own particular article into delicius by and by it is evidently a situation utilizing your data locales would you be able to please recheck the thought. much appreciated yet again.

  69. An intriguing dialog is value remark. I feel that it is best to compose more on this matter, it may not be a forbidden theme however normally people are insufficient to chat on such subjects. To the following. Here's to you.

  70. I've been hunting down some tolerable stuff on the subject and haven't had any fortunes up until this point, You just got another greatest fan!..

  71. wedding i... | wedding in the bahamas |

    A debt of gratitude is in order for this article extremely accommodating. much appreciated.

  72. trademark... | trademark registration |

    I've been hunting down some OK stuff on the subject and haven't had any fortunes up until this point, You just got another greatest fan!..

  73. I have bookmarked your site, the articles are path superior to anything other comparative websites.. a debt of gratitude is in order for an awesome web journal!

  74. Your site furnished us with important data to work with. Each and every tips of your post are magnificent. Much obliged for sharing. Continue blogging..

  75. The quality of information that you are providing is simply marvelous.

  76. I acknowledge all that you have added as far as anyone is concerned base.Admiring the time and exertion you put into your online journal and point by point data you offer.Thanks.

  77. Congrats you individuals are doing with this blog site.

  78. numériser... | numériser une cassette mini-DV  |

    Your online journal gave us profitable data to work with. Each and every tips of your post are amazing. You rock for sharing. Continue blogging,

  79. Pleasant learning picking up article. This post is truly the best on this important point.

  80. Extraordinary occupation for distributed such an advantageous site. Your web log isn't just helpful yet it is moreover truly inventive as well. There have a tendency to be relatively few individuals who can unquestionably compose not all that straightforward posts that creatively. Proceed with the decent composition

  81. How To Ki... | How To Kiss A Man To Make Him Fall In Love |

    I acknowledge all that you have added as far as anyone is concerned base.Admiring the time and exertion you put into your online journal and point by point data you offer.Thanks.

  82. paxosretr... | paxosretreats.com paxos villas |

    helpful data on subjects that bounty are intrigued on for this awesome post.Admiring the time and exertion you put into your b!..

  83. That is truly decent to listen. much obliged to you for the upgrade and good fortunes.

  84. I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.

  85. I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally.

  86. This article is such a nice and interesting one, I'm very satisfied with the provided contents. I hope more excellent articles would be posted in your website. Thank you so much for this and keep sharing.

  87. moos | comaptibilité swf avec IE8 |


    Très intéressant comme sujet, j'ai un swf qui ne fonctionne pas avec IE8 quelle est d'après vous la bonne méthode d'intégration ?

    voici le code ça fonctionne avec FF12,Safari 5 mais pas avec IE8

    <!-- MODULE Home Featured Carousel Products -->
    {if isset($products) AND $products}
    <embed src="modules/homefeaturedcarousel/3DCarouselDev.swf" flashvars="xmlprovider=modules/homefeaturedcarousel/files/urunxml.php" quality="high" pluginspage="http://...ayer" play="true" loop="true" scale="noscale" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="3DCarouselDev" menu="False" allowfullscreen="false" allowscriptaccess="sameDomain" salign="lt" type="application/x-shockwave-flash" align="lt" height="230" width="750";>
    <!-- /MODULE Home Featured Carousel Products -->

  88. Contrairement, à ce qui est indiqué en haut de cette page, il n'y a plus de Swfobject utilisé en page d'accueil.
    C'est en lisant cette autre page ( http://...vec-jQuery ) que j'ai compris que Swfobject avait été remplacé par un slideshow développé avec jquery.
    Merci pour votre site qui explique très simplement certaines choses qui m'intriguaient.

  89. Creation... | swfobject / indexation des pages |

    Le swfobject permet de donner un Title et description à toutes les pages ?
    Merci !

  90. Stéphane | Re : et le référencement |


    J'ai fait quelques tests à ce sujet, je n'en suis pas si sur que vous à dire vrai, les contenus semblent s'indexer de manière tout aussi honorable lorsqu'il sont placés dans la balise object.
    Je n'ai toujours pas réellement de préférence, sauf dans le cas d'un site full flash ou il est sans doute préférable d'utiliser un framework comme Gaia qui prend en compte les contraintes SEO.

  91. julien Tr... | Et le référencement? |

    Il ne faut pas oublier que le référencement se fera correctement en utilisant le swfobject et pas la méthode traditionnelle...