Has anyone had any success with resizing the SWF to fit the user's screen res?
I tried that 100% but that seems to only work in IE.
When I tried that in Firefox it made the site the size of a thumbnail.
Printable View
Has anyone had any success with resizing the SWF to fit the user's screen res?
I tried that 100% but that seems to only work in IE.
When I tried that in Firefox it made the site the size of a thumbnail.
Yeh my site is the same. It only works for IE, FF and NS dont seem to support the feature :(
Here is a script I found on Dreamworks website. It resizes the flash movie to the user's resolution. Can anyone modify this to work with anyone elses website? I'm not much of a javascript person.
Code:<script language="JavaScript">
sw = 985;
sh = 600;
if (screen.width >= 640) {sw = 580; sh = 353};
if (screen.width >= 800) {sw = 720; sh = 438};
if (screen.width >= 1024) {sw = 950; sh = 579};
if (screen.width >= 1152) {sw = 1052; sh = 640};
if (screen.width >= 1280) {sw = 1180; sh = 719};
if (screen.width >= 1600) {sw = 1400; sh = 853};
<!--
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function dwmovies_v2_DoFSCommand(command, args) {
var dwmovies_v2Obj = isInternetExplorer ? document.all.dwmovies_v2 : document.dwmovies_v2;
//
// Place your code here.
//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub dwmovies_v2_FSCommand(ByVal command, ByVal args)\n');
document.write(' Call dwmovies_v2_DoFSCommand(command, args)\n');
document.write('End Sub\n');
document.write('</script\>\n');
}
//-->
</script>
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
TM & © 2005 DreamWorks LLC. All Rights Reserved.
PLAY
-->
<div class="boundingbox" align="center" id="container">
<script>
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + sw + '" height="' + sh + '" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain"/>');
document.write('<param name="movie" value="dwintro.swf"/>');
document.write('<param name="quality" value="best"/>');
document.write('<param name="bgcolor" value="#000000"/>');
document.write('<embed src="dwintro.swf" quality="best" bgcolor="#000000" width="' + sw + '" height="' + sh + '" swliveconnect="true" id="dwmovies_v2" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/></embed>');
document.write('</object>');
</script>
Please search, as mentioned in the sticky...
Though, here's the answers.
http://www.flashkit.com/board/showthread.php?t=628118
______________
Also, you don't need a java script like that.
[Unless, you have sites made for each specific size.]
I did search...Anyway, here is the solution.
Set your sizes to 100%
Both height and width. Make sure you change all four occurances.
Then open the HTML file and delete the document type declaration. It will look like this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
REMOVE IT COMPLETELY!
Save the file and enjoy.
It works in IE, Firefox and Netscape. I don't have any others to test it in.