Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen.availheight used to load flash movie

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
I am using javascript to load a flash movie and I want to set the movie size to fit the screen 100%.

I have used screen.availHeight to get the screen dimensions but have found that I needed to tweek the figure ( -175 ) to get a better fit.

Could someone explain why this is so and is this the best way to get a close to 100% fit. It seems to act differently in Firefox and IE but results are fairly good. I am using the script to load the movie to avoid IE's click to activate this control warning.

<center><p id="site"><a href=" Upgrade to Flash 8</a> to use this sitedemo.</p></center>

<script type="text/javascript">

var scrWidth = (screen.availWidth - 50).toString();
var scrHeight = (screen.availHeight - 175).toString();

var FO = { movie:"movie.swf",width:scrWidth,height:scrHeight,majorversion:"8",build:"0",bgcolor:"#000000"};
UFO.create(FO,"site");
</script>
 
ice78991, you could use

Code:
document.body.clientHeight
document.body.clientWidth

as I believe these act the same in both FF and IE.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top