Hello all, Swfobject is working great and it has truly helped solve a whole lot of problems. I only have one question that I hoped to get answered. What parameter would I use ,(scale ,no scale) I would assume ?, to both not scale the movie while centering AND not crop the movie.
Hi Craig, just use the actual size in pixels, as shown in example below (parameters 3 and 4 of var so - width and height). Use noScale in your flash publish settings. You should centralize it with CSS. I´m not a CSS master, but I guess it´ll work. (Someone please correct if that´s the case... ;) )
Example: Let´s say you have a 520x300 pixels swf movie.
CSS FILE #centralize{ position: absolute; left: 50%; top: 50%; margin-left: -260px; margin-top: -150px; height: 300px; width: 520px; } In your HTML file: <div id="centralize"> <!-- If javascript is disabled this text will be displayed --> <p>Write alternate content here.</p> </div>
<script type="text/javascript"> <!-- // embeds flash into html if javascript is enabled. otherwise, content presented up, in 'centralize', will be displayed var so = new SWFObject("myMovie.swf", "myMovie", "520", "300", "8", "#FFFFFF", true); so.setAttribute('xiRedirectUrl', 'http://www.yourdomain.com/'); // must be the absolute URL to your site so.write("centralize"); //--> </script>