How To Embed SWF In HTML Code Or WordPress Post?
For those who would like to show or add a Shockwave Flash game in the HTML page or blog post, here is a template of code for reference.
Unlike embedding Flash Video file (FLV) in HTML code, the template code used to embed SWF file is relatively “easier” and “simpler”.
Although, it’s still a “satay” of OBJECT tag and EMBED tag, in order to satisfy Microsoft and non-Microsoft web browsers, especially those older versions.
According to Adobe Technote, OBJECT tag is favoured by Internet Explorer 3.0 or later or any web browser that supports Flash ActiveX control, while the EMBED tag is used by Netscape Navigator 2.0 or later or web browsers that use Netscape-compatible plugin version of Flash Player.
Template code for embedding SWF file in HTML code or blog post
1) Upload the SWF file (Shockwave Flash) to web directory. Using WordPress blog as example, this is as simple as uploading an image file in post editor mode.
2) Copy the web path of the uploaded SWF file.
3) Copy and paste the following code into HTML code or blog post editor, update the red-colour text with the web path of uploaded SWF file.
The blue-colour text is optional for change. While the width and height are self-explainable, the id is “nick-name” of the SWF file and it should be unique among embedded SWF files within the single web page.
Note: Don’t simply copy and paste this template code without updating the SWF’s web path, as the hotlinking prevention will stop it from working on your sites.
Sample SWF file embedded, with reference to the template code above – A little Shockwave Flash game featuring piano, developed by 100CN.

Although, it’s still a “satay” of OBJECT tag and EMBED tag, in order to satisfy Microsoft and non-Microsoft web browsers, especially those older versions.
According to Adobe Technote, OBJECT tag is favoured by Internet Explorer 3.0 or later or any web browser that supports Flash ActiveX control, while the EMBED tag is used by Netscape Navigator 2.0 or later or web browsers that use Netscape-compatible plugin version of Flash Player.
Template code for embedding SWF file in HTML code or blog post
1) Upload the SWF file (Shockwave Flash) to web directory. Using WordPress blog as example, this is as simple as uploading an image file in post editor mode.
2) Copy the web path of the uploaded SWF file.
3) Copy and paste the following code into HTML code or blog post editor, update the red-colour text with the web path of uploaded SWF file.
The blue-colour text is optional for change. While the width and height are self-explainable, the id is “nick-name” of the SWF file and it should be unique among embedded SWF files within the single web page.
Note: Don’t simply copy and paste this template code without updating the SWF’s web path, as the hotlinking prevention will stop it from working on your sites.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="498" height="380" id="test1"> <param name="movie" value="http://www.walkernews.net/piano.swf" /><embed src="http://www.walkernews.net/piano.swf" width="498" height="380" name="test1" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>
Sample SWF file embedded, with reference to the template code above – A little Shockwave Flash game featuring piano, developed by 100CN.
Custom Search






2010 •
Thanks, Just what I was looking for.
Excellent work.
Rick
Thanks heaps!
swf embed; doesnt work; i copied yr codes and made a post to my wordpress; itdoesnt work; any ideas
Hi,
I tried your code to embed swf into my WordPress page. Somehow, it’s not working.
Is it because it’s XML driven and the videos and images are in external folders (which by the way are included in the uploaded file)?
the swf works by itself when I go directly to the swf url (as html page) but not when I embed it in my WordPress file!
Any thoughts????
Hey!
It works great, was just what I’ve been looking for. I’ve been trying out the Kimili plugin for wordpress but didn’t have any luck with that… I wonder why? Anyways, thanks for your post!
Cheers,
Noah
Thanks man, you saved my bacon!
Hey! It works! First time lucky. Now quick question – what to do to request that it only plays one time?
I think that control is on the SWF game itself, not the embedding code.
Hi i have i have been trying this in a website named tinierme i have been trying to post swf files on my diary but every attempt i make always ends up in failure i even try the codes that is posted above but no luck ^^ was wondering if anybody can help me on this one thx so much^^
Hi and thanks !
Works great here…
Thanx! works great!