# Scaling Embedded Flash Files

**URL:** <https://forum.kirupa.com/t/scaling-embedded-flash-files/305182>\
**Category:** flash\
**Created:** [February 20, 2010, 3:17pm UTC](https://forum.kirupa.com/t/scaling-embedded-flash-files/305182 "2010-02-20T15:17:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wh1012](https://avatars.discourse-cdn.com/v4/letter/w/bbce88/32.png) [@wh1012](https://forum.kirupa.com/u/wh1012)\
**Post date:** [February 20, 2010, 3:17pm UTC](https://forum.kirupa.com/t/scaling-embedded-flash-files/305182/1 "2010-02-20T15:17:29Z")

</div>

I have my Flash file embedded using swfObject and I want the Flash file to scale with the size of user’s resolutions and browser windows. If I view my Flash file in the stand alone viewer it will scale properly, but not when it is embedded in the html page. I don’t want it to fill the whole browser window, but stay proportional to the space it is centered on the page.

What commands do I need to add to have it scale properly?

Here is the code:

> \<style type=“text/css”\>  
> body { padding-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom: 0px; margin: 0px; width: 100%; height: 100%;  
> overflow: hidden;  
> text-align: center;  
> }  
> #myContent {  
> margin-left: auto;  
> margin-right: auto;  
> width: 50em;  
> text-align: left;  
> }  
> \</style\>\</head\>  
> \<script type=“text/javascript” src=“swfobject.js”\>\</script\>  
> \<body bgcolor=“#000000”\>

\<div id=“flash”\>  
\<div style=“text-align:center; padding:30px;”\>  
\<span class=“error”\>This area requires javascript and flash.\</span\>  
\</div\>  
\</div\>

\<script type=“text/javascript”\>  
var so = new SWFObject(“gallery\_CS4.swf”, “loc”, “1152”, “900”, “9”, “#000000”);  
so.write(“flash”);  
\</script\>
