Flash detection script

I just followed the flash detection tuturial. The thing that I want to do is to open the flash file in a new window. I am sure that this is really easy, but I am not a programmer. If anyone could help, I would really appreciate it. Thanks:flower:

So i dont get it what you exactly need ?

If i am right you want the page detect the flash plugin and then if you have a plugin the page will redirect you to the flash page am i right ?

you are right. I have that part of the equasion down. What I want to do is have the flash page open in a new browser window.

this is the script that I have so far. I just want the flash page to open in a new window
<SCRIPT LANGUAGE=JavaScript1.1>
<!–
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes[“application/x-shockwave-flash”]) ? navigator.mimeTypes[“application/x-shockwave-flash”].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins[“Shockwave Flash”].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words*)))
continue;
var MM_PluginVersion = words*;
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf(“MSIE”)>=0
&& (navigator.appVersion.indexOf(“Win”) != -1)) {
document.write(’<SCR’ + ‘IPT LANGUAGE=VBScript&gt;
’); //FS hide this from IE4.5 Mac by splitting the tag
document.write(‘on error resume next
’);
document.write(‘MM_FlashCanPlay = ( IsObject(CreateObject(“ShockwaveFlash.ShockwaveFlash.” & MM_contentVersion)))
’);
document.write(’</SCR’ + ‘IPT&gt;
’);
}
if ( MM_FlashCanPlay ) {
window.location.replace(“http://www.nataliebehring.com/photo-portfolio.html”);
} else{
window.location.replace(“http://www.nataliebehring.com/noflash.html”);
}
//–>

</SCRIPT>

*Originally posted by jenwhitie *
this is the script that I have so far. I just want the flash page to open in a new window
<SCRIPT LANGUAGE=JavaScript1.1>
<!–
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes[“application/x-shockwave-flash”]) ? navigator.mimeTypes[“application/x-shockwave-flash”].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins[“Shockwave Flash”].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words
)))
continue;
var MM_PluginVersion = words
;
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf(“MSIE”)>=0
&& (navigator.appVersion.indexOf(“Win”) != -1)) {
document.write(‘<SCR’ + 'IPT LANGUAGE=VBScript&gt;
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write(‘MM_FlashCanPlay = ( IsObject(CreateObject(“ShockwaveFlash.ShockwaveFlash.” & MM_contentVersion)))
‘);
document.write(’</SCR’ + 'IPT&gt;
');
}
<–me thinks that the mistake is here !!!
if ( MM_FlashCanPlay ) {
window.location.replace(“photo-portfolio.html”);
} else{
window.location.replace(“noflash.html”);
}
//–>

</SCRIPT> **

try this code now it should work it not necesary to give exact link there

if it doesnt work tell me and me will give you another me own script to detect flash :smiley:

It works, but I want the “photo-portfolio.html” to open in a new window. Looks to me like the code replaces the initial page with the flash page. I just want to change that so it opens in a _blank window. Maybe your script would work better. Thansk for your help.

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wooooooooooooooooooooooopsssssss sorry didnt get you so you need the page open in a new window !!:stuck_out_tongue:

wait a sec me will look for the code :smiley:

thanks a bunch for your help!!

if ( MM_FlashCanPlay ) {
window.OpenNewWindow(“photo-portfolio.html”);
} else{
window.OpenNewWindow(“noflash.html”);
}
//–>

now this should work !!!:smiley: No problem for me help please ask me if you will need somethhing else :stuck_out_tongue_winking_eye:

Thank you very much!! I thought it would be that easy.

:)no probs :smiley: