Monday, September 24, 2007

How to add SWF files to blog posts?

Adding images and videos to blogs is as easy as pie. HTML already supports images through the IMG tag and videos can be inserted through the "Add Video" options in blogger. Even if your blogging platform doesn't give you an easy way to add videos you can do so by uploading the videos to video sharing sites like YouTube. YouTube will generate a link to the video which you can use to embed that video in your blog. But adding SWF files  isn't such straightforward. For this you have to add a small code to your blog. It's very easy. Just upload the SWF files to ImageShack or any other image sharing site. Now add the following code wherever you want the flash file to appear in your blog  post and then replace  file_url with the actual link to the flash file.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash /swflash.cab#version=6,0,29,0" width="405" height="400">
<param name="movie" value="file_url">
<param name="quality" value="high">
<embed src="file_url" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="405" height="400"></embed></object>

Note, that the "width" and "height" values in the above code needs to be changed too according to the size of the flash file. See this example of how I added SWF files in my blog.

25 comments:

  1. Hello Kaushik.

    I just want to know why some IE browsers can't see those animations?

    They installed the flash player without success.

    Thanks for any help

    BTW, very nice blog you have!. Congrats.

    Alexander
    http://alexhomar.blogspot.com

    ReplyDelete
  2. Some IE browsers are having trouble viewing the animation? But it is working at my end.

    Use IE7.

    ReplyDelete
  3. Hey, thanks for the code...I didn't realize I couldn't just upload and post .swf files until 5 minutes ago when I tried to for the first time...hehehe.

    Thanks again,
    peace,
    zOnk

    ReplyDelete
  4. i followed everything, but i get a 'movie not loaded'

    ReplyDelete
  5. If you get movie not loaded, either you have flash disabled on your browser or the swf file doesn't exist.

    ReplyDelete
  6. movie not loaded - and flash is not disabled on my browser , swf was created 5 seconds ago for testing. but nothing

    ReplyDelete
  7. hi,

    do you know how to embed a swf file containing flv video in it?

    ReplyDelete
  8. If it's a video, upload it to Youtube or any other video sharing site and use the embed code to post it in your website.

    ReplyDelete
  9. didnt seem to work for me either im using blogspot.com and the imageshack website said some error when i tried to look at my swf

    ReplyDelete
  10. ok i seemed to fix the problem using a swf file hosting website will fix your problem
    and this is the swf hosting site http://megaswf.com

    ReplyDelete
  11. I tried other examples on other sites however your code worked the best. I added my flash banner to our Ning Social network home page and blogsite.

    Example http://isuntangle.typepad.com/blog/2010/04/why-it-industry-experts-are-rating-is-untangle-agile-it-management-ondemand-first-in-its-class-.html

    ReplyDelete
  12. Works, but..

    Mine is a banner.. whats the code for linking it to external site?

    ReplyDelete
  13. Thankyou bro....

    http://sayyadimran.blogspot.com/p/al-islah.html

    ReplyDelete
  14. @blukazs: The link must lead directly to the SWF file, like http://example.com/movie.swf

    ReplyDelete
  15. do you know a site where i can upload flash files? imageshack doesnt work for me.

    ReplyDelete
  16. the megaswf site it the best I've come up with. On that you have to pay to embed your swf, so it only works as a link to their own site, with your uploaded material. better than nothing.

    ReplyDelete
  17. here is flash&snow effects please check it
    http://blue14hackers.blogspot.in/p/cd-recovery-toolbox-free.html

    ReplyDelete
  18. Hi,
    Can u pls tell me in detail how to upload a swf file to web or a blog.

    ReplyDelete
  19. If any one know how to upload a swf in to a blog or a web,please revert back.

    ReplyDelete
  20. @karthikreddy, you can't upload SWF files to blogger. You must upload to file serving service like Dropbox or image sharing service that supports SWF, then use the embedding code.

    ReplyDelete
  21. I'm been looking for this for my blog. I'll give this a try. Thanks.

    ReplyDelete
  22. step1:upload your swf files in google doc or similer sites
    step2:go to your blogger dashboard and add the wedget as embaded and put your swf file link


    thats it.....by www.blue14hackers.blogspot.com

    ReplyDelete