A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: embed with widh relative to height

  1. #1
    Member
    Join Date
    Jan 2010
    Posts
    30

    embed with widh relative to height

    ive been able to embed my swf as an html object with its height and width relative to the window size, which was step one. now, i want to preserve the aspect ratio, so that the height is always relative to the width. i know this isnt a javascript or html forum but i figured someone here must have wanted to try this at some point. heres what i tried that didnt work:

    javascript
    Code:
    window.onresize = function()
    {
    document.getelementById("containerA").style.width=document.getelementById("containerA").style.height/20+'px';
    }
    html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
      <head>
        <title>SWFObject - step 1</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<style type="text/css" media="screen">
    	html, body, #containerA { width:100%; height:100%; }
    	body { margin:0; padding:0;  overflow:hidden;}
    	</style>
    
    	<style type="text/javascript" src="resize.js"></style>
    
      </head>
      <body>
        <div id="containerA">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
            <param name="movie" value="yankeeScreenMenu.swf" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="yankeeScreenMenu.swf" width="100%" height="100%">
    	<param name="quality" value="autohigh" />
    	<param name="menu" value="false" /> 
            <!--<![endif]-->
              <p>Alternative content</p>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
          </object>
        </div>
      </body>
    </html>

  2. #2
    Member
    Join Date
    Jan 2010
    Posts
    30
    i found a solution

  3. #3
    Member
    Join Date
    Feb 2006
    Posts
    96
    maybe you could share it so the next person that has a similar situation could be informed?

    just a thought.

  4. #4
    Member
    Join Date
    Feb 2007
    Location
    Russia
    Posts
    37
    Hello. What the solution? Can you post it here?
    Submit good games here -
    gamebalance.com is my site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center