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.


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.
<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.YourDomain.com/YourFile.swf" /><embed src="http://www.YourDomain.net/YourFile.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



2013 •
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!
it doesn’t work with wordpress blog
I have embeded swf into Html page, but my swf file gets overlapped on the html menu, how can I resolve this issue, guide me please.
thank you! worked a treat in wordpress
Thanks , this method works gr8 in WP .
We tried it, changed the width/height/swf path, all we get is a blank box. The swf file was saved in a different size, we changed it to a smaller size, is that why? Thanks for your help
Thanks. Works like a charm.
Thank you, it helped to implement given banner to WP 2.9 blog ant change banner’s size.
Embedding Flash properly in WordPress posts was such a pain that I wrote a plugin to make it as simple as embedding images. Yes, this is a shameless plug, but I have gotten good feedback from other WordPress users. Hopefully it can make life easier for you, too if you are embedding Flash on your site. The embedding is all XHTML compliant. You can get the plugin here: http://wordpress.org/extend/plugins/swfobj/
Any feedback is welcome.
Hi there,
I’m new to HTML, but after I pasted your code into my HTML file and changed the src, width, height, and id values, it still does not show up on my website. When I right-click, the “Movie (is) not loaded…” I’ve placed the .swf in my parent directory (and made sure that the path is correct), so I do not know what is wrong. Any ideas?
Thank you very much,
Chris
If you directly paste it link of “src” on web browser, does it works?
Does the web server has permission to read the swf?
It works fine. But how do make the play and progress bar to show, cos right now I can’t pause or forward it. It just plays the video till it comes to an end
Thanks for the help! This worked liket a charm!
Thank you very much. I solved my problem thanks to this. Turkish did not have any of this information source.
Thanks again ..
Thank you sooooo much this was exactly what I was looking for
Hello, I tried to use the code above in a text-html widget in the sidebar, but when I clicked save, it automatically transformed to a hyperlink pointing to my .swf file. The same thing happened whith all the variations of the code I found on the Internet. Do you have any idea what is going wrong? Am I missing some security permissions credentials?
Many thanks for your post Walker. A big help.
Hi. i am having a problem with my embeded swf game. i write the code and the game adress right, but it doesn’t play on my site. all i get is a colored background with the height and width i requested.
can any1 help me?
Cheers!
Holey Moley, that is so sweet easy, thanks!!
Man….. thanx for sharing !! Saved me tonight ; )
Thank you! it was so fast and easy!
Thank you for the code.
But I have a swf with some external variables in a text file. Could you please help me out with the code if I were to implement this swf along with the var.txt
I know having the swf along with the txt file in the same root folder is enough, but I don’t know how to access the root folder where the pages are stored.
Please help, thank you. :)
Thank you!!! saved me a ton of work tonight and this worked really well in my wordpress blog!
This was great help! I was able to place this shockwave code on my site. Hats off to you !
I’ve used two of your posts today with great success. The first was for embedding .flv files and now this. You are a man of many talents. I appreciate you making this information public rather than just sitting on your wealth of knowledge.
Excellent! Worked like a charm! Thanks!
didn’t work! stick in 5% !
I think you deserve a big thanks for this. Helped me out big time! Thank you!
Just a note to say thankyou – I have been designing some swf to use as a way around the sound restrictions, by linking the sound via the swf to the mp3 on the server, it works on my server, have got the swf on, but am just working now on the file path of the music, thanks once again for posting the info on embedding swf in WordPress blog (post in my case)
Hello sir/mam
I have been trying to embed the swf file in wordpress so please help me i have used these code but i did not get sucess please tell me
Thx man,its cool :)
thanks sweetheart! :P
Hey thanks for this code, but when i click on the banner i would like to link some website. what is missing to get a forward to another webpage?
Thank you. You solved the problem I tried to figure out for some time. Thank you again.
BTW could you share tips of how to link to another URL from SWF file?
Thank you, works like a charm.
Great advice so simple once you know how !
Worked a treat.
Many Thanks
Adding that code was a great help. Thanks a lot!
Thank you for these great codes! It works well on my wordpress page but not the HTML email (function Mail Subscribers using Subscribe2 HTML). So I wonder what do you mean by “updating the SWF’s web path”?
Thanks Man.Its Works… :D
how to disable autoplay of swf file when i embed it in my page on wordpress, tnx!!
OMG thank you….after trying so many things to get the swf image to work this simple code helped!
You are a saviour!
Thank you! it worked just as i need it! (;
Thanks a lot! It works perfectly.
Works great with my wordpress! Would you know if it is possible to have it re-size, like a % value instead of pixel value? I have a 1080×1080 swf video, and a dynamic page??
this is only for professionals.
much to complicated!!!!
WOW, Why can not everyone explain these technical things so simple && straight forward as you have here. You have ended my 3 day experience of trying to install flash on my page……THANK YOU SO MUCH!!!!!!!!!!!!!
Thanks for code – works well!
The embed is fine in my blogger unless the swf has an embedded swf in it, then the embedded SWF doesnt play for some reason…any ideas?
How do I insert a URL with the flash object so that when you click on it, it takes you to another website?
Thanks. Good as gold
Thank you so much for this! I’m not a web designer/developer at all. This was so simple and helpful!
Very Good!
Could you give the code for a dynamic publication of the swf movie?
Thanks
Thank you so much bro
If this doesn’t work, make sure you check permissions on the swf file, try 775.
thanks, just looking for a simple code like this.
works fine just the way i want it