Resize Flash at runtime
If your content is bigger than the average screen size, using a flash scrollbar for the entire document is really slow and not user-friendly, so its better to enlarge flash to fit the content and scroll the entire page with the browser's scroll bar.
Put the flash object in a div:
HTML:
-
...
-
<SCRIPT LANGUAGE="JavaScript">
-
<!--
-
function newSize(width,height) {
-
if(document.all && !document.getElementById) {
-
document.all['myflash'].style.pixelWidth = width;
-
document.all['myflash'].style.pixelHeight = height;
-
}else{
-
document.getElementById('myflash').style.width = width;
-
document.getElementById('myflash').style.height = height;
-
}
-
}
-
//-->
-
</script>
-
</head>
-
<div id="myflash" style="position:relative; width:100%; height:100%; z-index:1; min-width:1000px;">
-
...
-
</object>
-
</div>
and in the movie do:
Other info here
[...] I've found that resizing a flash movie to fit his content has a little drawback: the mouse wheel doesn't work when the movie has focus, and in my case the movie has width: 100%. Luckily I've found a nice javascript to scroll the page. [...]
Pingback by Madarco DevBlog » Blog Archive » Scroll browser window inside Flash — November 14, 2006 @ 2:13 pmThis was pretty helpful stuff, thanks!
Comment by flashman — December 28, 2006 @ 2:10 pmHi,
Comment by LadySamG — November 1, 2007 @ 10:58 pmI tried your code and it works fine in a mozilla firefox browser, but not with IE7. Is there some part of this code that IE7 doesn't like?
I don't know, it seems to work to me, but if you find some problem let me know
Comment by Madarco — November 10, 2007 @ 8:01 pm