This Rails plugin makes including an swf object easier, no more writing javascript for that, just plain ruby.
To install this plugin:
script/plugin install git://github.com/japetheape/swfobject_helper.git
Make sure swfobject.js is in your javascripts dir (download here:code.google.com/p/swfobject/) and you have in your header of your layout:
<%=yield :header %>
<%=swf_object('/flash/niftyplayer.swf', 'player') %> <div id="player"></div>
Produces:
<script type="text/javascript"> //<![CDATA[ var swf = swfobject.embedSWF( "/flash/niftyplayer.swf", "player", 100, 100, "9.0.0", '/flash/playerProductInstall.swf', {}, {}, {}); //]]> </script>
<%=swf_object('/flash/niftyplayer.swf', 'player', :flash_vars => {:flashvar1 => 'value1'}, :params => {:param1 => 'value1'}, :version => '10.0.0', :varname => 'swf_othername') %>
Produces:
<script type="text/javascript"> //<![CDATA[ var swf_othername = swfobject.embedSWF( "/flash/niftyplayer.swf", "player", 100, 100, "10.0.0", '/flash/playerProductInstall.swf', {"flashvar1":"value1"}, {"param1":"value1"}, {}); //]]> </script>
Copyright © 2009 japetheape, released under the MIT license