Jump to content
Sign in to follow this  
SuperPaperSam

Automaticly Finding .swf's Width And Height

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

Share this post


Link to post
Share on other sites

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 by Abarrow

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...