Hi all.
This ones been bugging me for a few months now and I've finaly found a work around.
Basically if I publish a Flash site from Macromedia Flash to HTML such that the resultant swf file resizes to fill the whole browser window, it works fine in IE, Netscape & Opera. However in Firefox the swf file fills only 30% of the available browser window (which is usually too small to read)
Example: Try viewing this file in IE, Netscape or Opera. It should scale to fit the browswer window (whilst retaining the correct proportions). Now view it in Firefox. It only fills 1/3rd of the browser window.
When a an HTML file is generated by Flash it adds the following html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
NOTE the 'XHTML 1.0' bit. This is the code that causes the problem within Firefox.
There are 2 workarounds.
Woraround 1: change the above to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This works fine if your site is purely a Flash site, but isn't really puka coding as it should contain the link to the dtd file (whatever that is)
Woraround2: Change the above to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Which is correct html wise but unfortunately reintroduces the original scaling problem back into Firefox !!!!!
The solution here is to create a css file (you can use notepad, and just save as .css instead of .txt), even if you don't use them in your Flash movies. The file should contain the following:
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}
I saved this as 'false.css'
Now add the complete text to your HTML file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<link href="false.css" rel="stylesheet" type="text/css">
and post the false.css file in the same directory.
Now Firefox will scale the embedded swf file to fill the browser window.
You can test this here
One problem that I have found however that the above now introduces a margin along the top of the window in Opera. Could someone confirm this for me?
Hope this helps someone.
Egg


Reply With Quote
Bookmarks