Jump to content

Automaticly Finding .swf's Width And Height


SuperPaperSam

Recommended Posts

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

Link to comment
Share on other sites

  • 2 months later...

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>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...