new Embed stuff in your pages: Embed flash games in your site
Add to Technorati Favorites

Wednesday, March 28, 2007

Embed flash games in your site

Embedding flash games in your site is just as simple as embedding youtube videos. Take the absolute location of the swf file and write the following code, making sure that the src attribute for the embed tag is replaced with the URL to the swf file.

Here's the code:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,0,0" width="400" height="300">
<param name=movie value="week13/images/copter.swf">
<param name=quality value=high>
<embed src="" quality=high pluginspage="" type="application/x-shockwave-flash" width="400" height="300">


And here's how the game looks like. Give it a try!


lavaking said...

well i tried to add a flash file but for some reason i get an error report and i did what you said and copied the code then i replaced the "srf" with the url but it didn't work. do you know what could be wrong?

Marius Hanganu said...

You have to download the file. I think that embedding swf-s from other domains enters the XSS jurisdiction (cross site scripting).