How to make flash movie to scale proportunatly to div width?

Posted by user73119 on Stack Overflow See other posts from Stack Overflow or by user73119
Published on 2009-06-20T01:04:44Z Indexed on 2010/06/12 22:12 UTC
Read the original article Hit count: 251

Filed under:
|
|
|
|

I have put together an example page detailing my problem

My website is going to have a main wrapper that is set to a max-width property for compatible browsers. It will stretch to 940px across at max. When scaled down I would like the swf to scale proportionately with it. Like an image with width percent applied. The flash movie has the dimensions of 940 × 360 pixels.

I can't seem to figure out the correct attributes to add to the embed tag to get it to do this.

I am currently using jquery flash embed, but am open to other options, though this is my ideal.

In the example I have set the flash background to black.

When resize the browser window the flash movie doesn't scale proportionately to the div, only the photo does, leaving a blank canvas (black), while the div height stays the same. I can't add a height value in the CSS.

alt text

How do I make this scale correctly? Adding a noscale param only crops the image. The swf's height doesn't scale also.

All of my code can be viewed in the linked examples source.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery