转自:http://www.bit-101.com/blog/?p=523
Sometimes you need to have a full browser screen filled with a swf. Everyone knows how to do that. You go into Publish Settings, set Dimensions to “Percent” and Width and Height to 100.
The problem is that you still end up with a margin around the edge of the page. So you dive into the HTML and add in something to change the margin and padding to 0 for the body.
That works fine on many browswers, but on Firefox, maybe Mozilla too, it is totally broken. The Flash only fills about 100 pixels or so at the top of the page. After searching around, I found that Mozilla is very strict about its percentages. You are telling the swf to take up 100%, but 100% of what? The swf is in the body tag. The body tag is in the html tag, which is in the browser window. Most browsers will scale the html size to fill the browser window and scale the body to fill the html size.
Not so with Mozilla/Firefox. It doesn’t assume that html fills 100% of the browswer, or that body fills 100% of the html. So you have to tell it that.
The following little snippet in a styles tag in the html head handles all of this:
body,html {
margin:0px;
padding:0px;
height:100%;
}
I actually put this right into the default.html file in the templates Flash uses to create its html. Of course you have to take it out if you don’t need it, but I found it easier to delete than have to remember when I need it. That’s just me. If I were really organized, I’d create a whole new template for this purpose.
Sometimes you need to have a full browser screen filled with a swf. Everyone knows how to do that. You go into Publish Settings, set Dimensions to “Percent” and Width and Height to 100.
The problem is that you still end up with a margin around the edge of the page. So you dive into the HTML and add in something to change the margin and padding to 0 for the body.
That works fine on many browswers, but on Firefox, maybe Mozilla too, it is totally broken. The Flash only fills about 100 pixels or so at the top of the page. After searching around, I found that Mozilla is very strict about its percentages. You are telling the swf to take up 100%, but 100% of what? The swf is in the body tag. The body tag is in the html tag, which is in the browser window. Most browsers will scale the html size to fill the browser window and scale the body to fill the html size.
Not so with Mozilla/Firefox. It doesn’t assume that html fills 100% of the browswer, or that body fills 100% of the html. So you have to tell it that.
The following little snippet in a styles tag in the html head handles all of this:
body,html {
margin:0px;
padding:0px;
height:100%;
}
I actually put this right into the default.html file in the templates Flash uses to create its html. Of course you have to take it out if you don’t need it, but I found it easier to delete than have to remember when I need it. That’s just me. If I were really organized, I’d create a whole new template for this purpose.