wcjr
07-17-2003, 01:26 PM
Hello,
I'm very much a novice when it comes to JS. Much to my regret I rely on Macromedia to spew out JS for me. It's with this in mind when I ask the following.
Can the js below be modified to open a browser window in a "maximized" state, or, if not, can I set the w + h and have the pop up window centered? Any advice would be great.
I've tried to toy around with screen.availHeight and screen.availWidth but I must be placing them incorrectly or not adding enough to the script.
Thanks
---code---
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
function detectFlash(){
if (navigator.plugins){
if (navigator.plugins["Shockwave Flash 2.0"]
|| navigator.plugins["Shockwave Flash"]){
var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
flash2Installed = flashVersion == 2;
flash3Installed = flashVersion == 3;
flash4Installed = flashVersion == 4;
flash5Installed = flashVersion == 5;
flash6Installed = flashVersion == 6;
}
}
for (var i = 2; i <= maxVersion; i++) {
if (eval("flash" + i + "Installed") == true) actualVersion = i;
}
if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;
// uncomment next line to display flash version during testing
//alert("Flash version " + actualVersion + " has been detected!");
if (actualVersion >= requiredVersion) {
hasRightVersion = true;
if (useRedirect) {
MM_openBrWindow('flashpop.html','new','"top=0,left=0,resizable=yes" + ",width=" + screen.width + ",height=" + screen. height,scrollbars=0,menubar=0,toolbar=0,location=0
,status=0');
}
} else {
if (useRedirect) {
if(jsVersion > 1.0) { // need javascript1.1 to do location.replace
alert("This site requires Macromedia Flash Player 5.0 or above.\n Please download the correct version of this plug-in");
MM_openBrWindow('http://www.macromedia.com/software/flashplayer/','new2','');
} else {
alert("This site requires Macromedia Flash Player 5.0 or above.\n Please download the correct version of this plug-in");
MM_openBrWindow('http://www.macromedia.com/software/flashplayer/','new2','');
}
}
}
}
detectFlash();:confused:
I'm very much a novice when it comes to JS. Much to my regret I rely on Macromedia to spew out JS for me. It's with this in mind when I ask the following.
Can the js below be modified to open a browser window in a "maximized" state, or, if not, can I set the w + h and have the pop up window centered? Any advice would be great.
I've tried to toy around with screen.availHeight and screen.availWidth but I must be placing them incorrectly or not adding enough to the script.
Thanks
---code---
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
function detectFlash(){
if (navigator.plugins){
if (navigator.plugins["Shockwave Flash 2.0"]
|| navigator.plugins["Shockwave Flash"]){
var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
flash2Installed = flashVersion == 2;
flash3Installed = flashVersion == 3;
flash4Installed = flashVersion == 4;
flash5Installed = flashVersion == 5;
flash6Installed = flashVersion == 6;
}
}
for (var i = 2; i <= maxVersion; i++) {
if (eval("flash" + i + "Installed") == true) actualVersion = i;
}
if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;
// uncomment next line to display flash version during testing
//alert("Flash version " + actualVersion + " has been detected!");
if (actualVersion >= requiredVersion) {
hasRightVersion = true;
if (useRedirect) {
MM_openBrWindow('flashpop.html','new','"top=0,left=0,resizable=yes" + ",width=" + screen.width + ",height=" + screen. height,scrollbars=0,menubar=0,toolbar=0,location=0
,status=0');
}
} else {
if (useRedirect) {
if(jsVersion > 1.0) { // need javascript1.1 to do location.replace
alert("This site requires Macromedia Flash Player 5.0 or above.\n Please download the correct version of this plug-in");
MM_openBrWindow('http://www.macromedia.com/software/flashplayer/','new2','');
} else {
alert("This site requires Macromedia Flash Player 5.0 or above.\n Please download the correct version of this plug-in");
MM_openBrWindow('http://www.macromedia.com/software/flashplayer/','new2','');
}
}
}
}
detectFlash();:confused: