How to create a SWF that will encompass 100% of the browser window?
Submitted by: AdministratorThe following technique is also known as Full Browser Flash:
Set both the width and height of your SWF to 100% in your SWFObject definition
Include CSS to get rid of any default margins/padding and set the height of the html element, the body element and the entire chain of block level HTML elements that your SWF will be nested in to 100%, because Firefox (or: any Gecko based browser) in standards compliant mode (or: using a valid DOCTYPE) interprets percentages in a very strict way (to be precise: the percentage of the height of its parent container, which has to be set explicitly):
<style type="text/css" media="screen">
html, body, #containerA, #containerB { height:100%; }
body { margin:0; padding:0; overflow:hidden; }
</style>
Manage the scaling and alignment of your SWF and the positioning of your SWF's elements, within your ActionScript code, e.g.:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(event:Event):void {
// center stuff
}
Submitted by: Administrator
Set both the width and height of your SWF to 100% in your SWFObject definition
Include CSS to get rid of any default margins/padding and set the height of the html element, the body element and the entire chain of block level HTML elements that your SWF will be nested in to 100%, because Firefox (or: any Gecko based browser) in standards compliant mode (or: using a valid DOCTYPE) interprets percentages in a very strict way (to be precise: the percentage of the height of its parent container, which has to be set explicitly):
<style type="text/css" media="screen">
html, body, #containerA, #containerB { height:100%; }
body { margin:0; padding:0; overflow:hidden; }
</style>
Manage the scaling and alignment of your SWF and the positioning of your SWF's elements, within your ActionScript code, e.g.:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(event:Event):void {
// center stuff
}
Submitted by: Administrator
Read Online SWFObject Job Interview Questions And Answers
Top SWFObject Questions
☺ | How to avoid Active Server Pages error ASP 0139 when using static publishing and Microsoft IIS? |
☺ | Tell me why does Internet Explorer 6 and 7 show the error message J.parentNode is null or not an object? |
☺ | Explain why can we see memory usage increase on every page refresh in Internet Explorer? |
☺ | Tell us why does Firefox report Permission denied to call method Location.toString in the error console? |
☺ | Do you know why does Firefox load my SWF twice? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |