I am pulling my hair out trying to embed a flash file I have in a page, and have tried many variations of the following two ways:
swfobject
<head>
<%= javascript_include_tag 'swfobject.js' %>
</head>
.
.
.
<div id="dragndrop">This requires Adobe Flash to view</div>
<script type="text/javascript">
var flashvars;
var params = {
movie: "<%= asset_path('flash/drag-n-drop-w-action3b.swf') %>",
background: "#FFFFFF",
quality: "high"
};
swfobject.embedSWF("<%= asset_path('flash/drag-n-drop-w-action3b.swf') %>",
"dragndrop", "100%", "100%", "6.0.0", false, params);
</script>
Navigating to the page yields nothing, but outputs the following in browser:
<object id="dragndrop" width="100%" height="100%" type="application/x-shockwave-flash"
data="/assets/flash/drag-n-drop-w-action3b.swf" style="visibility: visible;">
<param name="flashvars" value="movie=/assets/flash/drag-n-drop-w-action3b.swf&background=#FFFFFF&quality=high">
</object>
I have tried it without the params, also, to no avail.
I have also tried manually adding it in several ways including as described here. This flash file is currently embedded on a different website successfully, and I have even copy-pasted the html there (fixing the path):
<object width="100%" height="100%" align=""
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="assets/flash/drag-n-drop-w-action3b.swf" name="movie">
<param value="high" name="quality">
<param value="#FFFFFF" name="bgcolor">
<embed width="100%" height="100%" align=""
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high"
src="/assets/flash/drag-n-drop-w-action3b.swf">
</object>
What am I doing wrong?
EDIT:
Following pipwerks help, I changed the code to:
var params = { background: "#FFFFFF",};
swfobject.embedSWF("<%= asset_path('flash/drag-n-drop-w-action3b.swf') %>", "dragndrop", "100%", "100%", "6.0.0", false, false, params);
However, it is still not quite working. The new HTML that is outputted is as follows:
<object id="dragndrop" width="100%" height="100%" type="application/x-shockwave-flash"
data="/assets/flash/drag-n-drop-w-action3b.swf" style="visibility: visible;">
<param name="background" value="#FFFFFF">
</object>