View Full Version : Swfobject not showing flash movie!!!

01-10-2009, 05:23 PM

I'm trying to get swfobject to work, but for some reason it's not showing the swf movie.

This is the code in the body:

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

<div id="flashcontent">
This text is replaced by the Flash movie.

<script type="text/javascript">
var so = new SWFObject("slideshow1.swf", "654", "250", "9", "#fff");

I downloaded the latest version of swfobject 2.1, and uploaded it to the js folder. In Flash CS3, I just use the flash format, and publish it.

I have noticed that there should be an id after "slideshow1"...

var so = new SWFObject("slideshow1.swf", "654", "250", "9", "#fff");

... but when I dragged slideshow1.swf into code view in dreamweaver, there doesn't seem to be an id:

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','654','height','250','src','slideshow1','quality','high','plug inspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','slideshow1' ); //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=9,0,28,0" width="654" height="250">
<param name="movie" value="slideshow1.swf" />
<param name="quality" value="high" />
<embed src="slideshow1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="654" height="250"></embed>

So, at the moment it's displaying the replacement text, but not the swf movie. What am I doing wrong here? Any help would be appreciated.

Many Thanks

01-10-2009, 05:35 PM
Are you using the old code with new sfwobject.js file?
Check the manual of new version, http://code.google.com/p/swfobject/wiki/documentation
(scroll down to see the dynamic method)

01-10-2009, 08:37 PM
Get rid of the AC code! You are using Dreamweaver, and you need to remove anything that Dreamweaver would have inserted into the document before adding the SWFObject code.

01-11-2009, 01:33 PM
Thanks very much, checked the manual of the new version, and now it's working fine.