SuperPaperSam 0 Posted August 30, 2009 Report Share Posted August 30, 2009 I'm placing hundreds of games on my site (and other flash content) and I'm looking for a faster way of embedding them.Currently I create a new HTML page and embed them using this code. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="----------width----------" height="----------height----------"> <param name="movie" value="----------game.swf----------" /> <param name="quality" value="high" /> <embed src="----------game.swf----------" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="----------width----------" height="----------height----------"></embed></object> This way works fine but I spend a long time just pasting this code into pages and changing the width/height/srcIf possable I would like to have a code that makes the .swf as big as possable (staying within the div) while maintaining is width to height ratio. Then I would just have to change the src. (which is MUCH faster then finding the max width's and height's)I'm hopping this is possible because it would save me a lot of time.Does anyone know how to accomplish this or a better (faster) way of embedding all my games?Thanks,SuperPaperSam Quote Link to post Share on other sites
Abarrow 0 Posted November 15, 2009 Report Share Posted November 15, 2009 (edited) Write a javascript function.eg: <html><head><script>function flash(width,height,src){document.write("<object width="+width+" height="+height+">");document.write("<param name=movie value="+src+">");document.write("<embed src="+src+" width="+width+" height="+height+">");document.write("</embed>");document.write("</object>");}</script></head><body><script>flash(40,400,"ball.swf")</script></body></html> Edited November 15, 2009 by Abarrow Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.