Click to See Complete Forum and Search --> : cheking for installed Flash Player


vinsa
11-18-2003, 10:49 AM
Hello,
first sorry for my english.
I need from script who
check web users for installed
flash player version 7 (only for IE).

When the user have not installed flash player7
the script alert "First install flash player 7"

Thank you in advance.

pyro
11-18-2003, 01:56 PM
Take a look at http://www.quirksmode.org/js/flash.html

beeready
11-18-2003, 04:25 PM
I generally use 'publish to detect' but I recently found that throws a lot of errors and Gil gave me this js in another thread to deal with IE/NS problems:

<script type="text/javascript">
if (document.all)
{document.write("<div id='left'>")
document.write("<embed src='salon1050-header.swf' width='750' height='720' quality='high'

pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'

wmode='transparent'><\/embed>");}
else
{document.write("<div id='nsheader'>")
document.write("<img src='salon1050-header.gif' width=742 height=246>");}
document.write("<\/div>");
</script>

but now I can't figure out how to throw the Flash detect part into the IE detect part (so that non-flash users get the .gif as well as NS users) even after looking at the site pyro suggested.

Any other suggestions?

Barrie

gil davis
11-18-2003, 04:31 PM
A search on Yahoo! came up with this:
http://www.macromedia.com/support/flash/ts/documents/scriptfree_detection.htm

beeready
11-18-2003, 04:47 PM
Hey Gil :)

So, if I put the object class id and codebase stuff in the js before the 'embed' it should work?

Like so:
<script type="text/javascript">
if (document.all)
{document.write("<div id='left'>")
document.write("<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" embed src='salon1050-header.swf' width='750' height='720' quality='high'

pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'

wmode='transparent'><\/embed>");}
else
{document.write("<div id='nsheader'>")
document.write("<img src='salon1050-header.gif' width=742 height=246>");}
document.write("<\/div>");
</script>

Or does that screw everything up?

Barrie

gil davis
11-18-2003, 05:09 PM
If you do it the way you posted, it will get screwed up. Watch your quotes.

See attached. If flash and if IE, the flash is shown. Otherwise, the GIF is shown.

beeready
11-18-2003, 05:47 PM
I didn't make any changes to it, just saved it as test4.htm and put it in the same directory as the other files:

http://www.salon1050.com/test4.htm

It works in IE but not in NS6 or Opera 6

W3 Validator approved it w/ no errors.

What did I screw up this time?

Barrie

gil davis
11-18-2003, 09:19 PM
Style3.css still has a negative z-index in it for the nsheader.

I don't know about Opera. I believe that it supports document.all for some reason. You can look at http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html to see what a thorough browser sniffer looks like.

beeready
11-19-2003, 08:49 AM
Can we say, "Barrie is an idiot?"

Thanks yet again Gil!

I'll see what I can do about Opera but my main feeling on the subject is that people running Opera are probably fairly accustomed to stuff not working for them.

As I said, I am only doing this little site as a favor to my friend the hairdresser (and SHE'S the blonde one! <g>) and I would like to give you (and/or the forum) credit for the js as I would NEVER have manged to figure it out on my own. If you hadn't stepped in and helped me out I would probably still be working on the 'hidden'/'visible' idea and have disolved into a big puddle on my keyboard by now ;p

Let me know how you would like me to phrase the credit and I will, very delicately <g>, attempt to add a comment line to do so :)

Thank you soooooo much!!!

Barrie

P.S. And its all valid html <vbg>:
http://www.salon1050.com
links still don't go anywhere yet

I popped this in the js:
// All Javascript provided by Gil Davis of Web Developer Forum (forums.webdeveloper.com)

Please let me know if you would rather have something else in its place and if WDF would rather I use a different url or something I am more than happy to do so!

b

gil davis
11-19-2003, 04:33 PM
That is fine by me... ;) I can reference it on my résumé.

However, I got the flash detection stuff from http://www.quirksmode.org/js/flash.html and they may require something.