Embedding SWF files

Bacause Flash had been created for web, soon afterwards many methods of embedding a Flash movie on a site appeared. Let me compare the two ways that I've used throughout several the years.

1) The default Adobe provided embed

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="550" height="400" id="Untitled-1" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="mymovie.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="mymovie.swf" quality="high" bgcolor="#ffffff" width="550"
height="400" name="mymovie" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>

If you're using Dreamweaver, your script might be a little different. There's that AC_FL_RunContent function that fixes the problem where users had to click on active content before interacting with it in Internet Explorer 7.

 

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

<script type="text/javascript">
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' , 'width','1600', 'height', '1200', 'src','index','quality','high','pluginspage' ,'http://www.macromedia.com/go/getflashplayer','movie','index' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1600" height="1200">
    <param name="movie" value="index.swf" />
    <param name="quality" value="high" />
    <embed src="index.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1600" height="1200"></embed>
  </object></noscript>

 

The above method of embedding Flash files is generally fine. It works perfectly with all major browsers, plus the script is automatically added to HTML code by Dreamweaver. The only drawback is - it might sound trivial - the script takes a little too much space in your HTML file, so that can be slightly annoying if you've got several embedds on one page.

2) SWFobject

 

SWFobject is probably the best way to embed your swf files. This script is easy-to-use, it's very search engine friendly, and most importantly, it works in all major web browsers.

Example

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

<div id="flashcontent">
Your swf will be loaded here (unless something goes wrong)
</div>

<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "200", "500", "8", "#336699");
so.write("flashcontent");
</script>

You can find much more information about SWFobject here.   I hope this tutorial helped you choose the right embedd script.  

Average: 4.3 (9 votes)