Skip to main content
August 11, 2009
Answered

swf files that scale with the browser

  • August 11, 2009
  • 2 replies
  • 1486 views

I uploaded a swf file with dreamweaver as a stand alone window and it works fine.  How do I get the swf file to scale larger or smaller as the user adjusts their browser window larger and smaller?  I would like to get the swf file to scale along with the browser window.  I posted this in dreamweaver but was told this is an action script issue.

This topic has been closed for replies.
Correct answer Missing Code

I found a simple solution, and I believe it is what you are looking for.

1. In Flash, go to File>Publish Settings

2. Click on the HTML Tab

3. Where is says Dimensions, select Percent

4. Though it is probably default, make sure the width and height are both set to 100.

5. Click ok then go to File>Publish

Now your movie should scale with the browser window.

If you do not have Flash, then you can simple work with this sample code below:

<object width="100%" height="100%" id="xyz" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="xyz.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="xyz.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="xyz"
    align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Notice how width and height are set to "100%"? That's all you need.

2 replies

Participant
June 10, 2010

This answer only provides a plain Flash generated html page with all of the code in the HEAD. How do I edit it like a normal html page to add my own elements to it?

I have tried every avenue possible to place my swf file into a Dreamweaver liquid template, only to find the swf never scales when the browser window changes.

June 16, 2010

an easier way would be to just set your margins to 0....that will still have it scale as well....

you can also set the appropriate size in the html ( like 900x600, and keep margins at 0 )

Missing Code
Missing CodeCorrect answer
Inspiring
August 12, 2009

I found a simple solution, and I believe it is what you are looking for.

1. In Flash, go to File>Publish Settings

2. Click on the HTML Tab

3. Where is says Dimensions, select Percent

4. Though it is probably default, make sure the width and height are both set to 100.

5. Click ok then go to File>Publish

Now your movie should scale with the browser window.

If you do not have Flash, then you can simple work with this sample code below:

<object width="100%" height="100%" id="xyz" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="xyz.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="xyz.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="xyz"
    align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Notice how width and height are set to "100%"? That's all you need.

August 14, 2009

Thanks for the quick reply. I tried this and it got me closer to what

I need but when I enlarge the swf file with this setting, I can see

the items off stage. It's a step in the right direction but what I am

looking for is just the flash file stage enlarging uniformly.