Hi all,
Here’s the problem.. I made a swf for a site that has an animated background, therefore a large witdh to cover resolutions up to 1280×1024.
Content-part in this swf is small in width so it doesnt need a scroll for resolutions starting from 800×600.
here you can see what i came up with, together with the help of a friend:
[URL=http://www.spiritz.nl/test/index.html]link to example
(the yellow is the content, the red the animated background)
my code:
[CODE]
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html><head>
<title></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<style type=”text/css”>
html,body { overflow-x:hidden;
}
</style>
[COLOR=DarkRed]<script language=”javascript”>
function moveWin(){
var winW = 630, winH = 460;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName==”Netscape”) {
winW = window.innerWidth;
}
if (navigator.appName.indexOf(“Microsoft”)!=-1) {
winW = document.body.offsetWidth;
}
}
var movieWidth = 1230;
var winleft = (movieWidth/2) – (winW/2);
scrollTo(winleft, 0);
}
</script>[/COLOR]
</head>
<body bgcolor=”#FFFFFF” topmarginb=”0″ leftmargin=”0″ [COLOR=DarkRed]onload=”moveWin()” onResize=”moveWin()”[/COLOR]>
<center>
<object classid=”clsid: D27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0″
id=”main” width=”1230″ height=”700″>
<param name=”movie” value=”main.swf”>
<param name=”bgcolor” value=”#777777″>
<param name=”quality” value=”best”>
<param name=”allowscriptaccess” value=”samedomain”>
<embed type=”application/x-shockwave-flash”
pluginspage=”http://www.macromedia.com/go/getflashplayer”
width=”1230″ height=”700″
name=”main” src=”main.swf”
bgcolor=”#777777″ quality=”best”
swLiveConnect=”true” allowScriptAccess=”samedomain”
></embed>
</object>
</center><br>
</body>
</html>
[COLOR=DarkRed]Now my problem is this does work in Internetexplorer and Maxthon, but not in Mozilla and Firefox…
I used the css to remove the horizontal scrollbar, since the background doesnt have to show completely. This also only works in IE and Maxthon, but this is of minor importance.
Anyone got a clue why it doesnt and how I can solve this? Thx in advance!