# Flash detection script

**URL:** <https://forum.kirupa.com/t/flash-detection-script/34743>\
**Category:** Uncategorized\
**Created:** [November 5, 2003, 11:38pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743 "2003-11-05T23:38:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenwhitie](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jenwhitie](https://forum.kirupa.com/u/jenwhitie)\
**Post date:** [November 5, 2003, 11:38pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743/1 "2003-11-05T23:38:55Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2003, 11:42pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743/2 "2003-11-05T23:42:01Z")

</div>

So i dont get it what you exactly need ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2003, 11:44pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743/3 "2003-11-05T23:44:18Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2003, 11:58pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743/4 "2003-11-05T23:58:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2003, 11:59pm UTC](https://forum.kirupa.com/t/flash-detection-script/34743/5 "2003-11-05T23:59:56Z")

</div>

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](http://www.nataliebehring.com/photo-portfolio.html)”);  
} else{  
window.location.replace(“[http://www.nataliebehring.com/noflash.html](http://www.nataliebehring.com/noflash.html)”);  
}  
//–\>

\</SCRIPT\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:06am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/6 "2003-11-06T00:06:03Z")

</div>

> \*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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:07am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/7 "2003-11-06T00:07:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:10am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/8 "2003-11-06T00:10:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:17am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/9 "2003-11-06T00:17:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:17am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/10 "2003-11-06T00:17:52Z")

</div>

wait a sec me will look for the code 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:18am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/11 "2003-11-06T00:18:43Z")

</div>

thanks a bunch for your help!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:27am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/12 "2003-11-06T00:27:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:28am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/13 "2003-11-06T00:28:12Z")

</div>

now this should work !!!😃 No problem for me help please ask me if you will need somethhing else 😜

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:29am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/14 "2003-11-06T00:29:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2003, 12:55am UTC](https://forum.kirupa.com/t/flash-detection-script/34743/15 "2003-11-06T00:55:59Z")

</div>

:)no probs 😃
