Link to home
Start Free TrialLog in
Avatar of Tournefort
Tournefort

asked on

Detect ver. 4 vs. ver. 3

I'm confused about serving swf's to browsers, and Macromedia doesn't provide much useful info. Specifically, I'd like to publish my movies as ver.4 but I understand that ver. 3 players are still more common than ver. 4. Therefore, I wonder what my options are. I suppose the easiest is to set it up to sniff browers for ver. 4 players, but I'm not at all sure what happens if you have a ver. 2 or 3 player installed. Can you update to ver. 4 quickly and painlessly? The only url that I've looked at from Macromedia instructs browsers to download, decompress, quit the browser, and run the exe., which is ridiculous as far as I'm concerned. If updating to ver. 4 is a minor inconvenience I'll require it of ver. 3 browsers; otherwise I'll have to set up alternative means to serve up a ver. 3 movie. So, can anyone tell me what happens if you hit a ver. 4 movie with a ver. 3 player? Or point me to info? Thanks.
Avatar of Wizard001
Wizard001

im almost positive the update is automated like when you first download flash.. i use flash 4 and i go to sites with flash 2 and 3 being used.. i play them just fine

but im not sure about vicea versa..

-brian
Flash 2 and 3 lack some capability as opposed to 4 (as with any other program's versions) but Flash has a knack for updating itself in most browsers. However, it's always safe to note that your site runs in SWF version 4.
Okay, how about getting a page to detect the version of flash yuor user has..

If the user has flash 4, let them in, if not either send them to a text only version of the site or open a new window with this page:
http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash

Version 4 is only about 240k and will take no time at all to download.

Here is the code I used to detect flash version in www.assembly-line.co.uk:

<SCRIPT LANGUAGE="JavaScript">
flashver=0

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ?
      navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4) {
 flashver=4
}

if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.userAgent.indexOf("Windows")>=0 && navigator.userAgent.indexOf("3.1")<0)) {
document.write('\<SCRIPT LANGUAGE=VBScript\> \n');
        document.write('on error resume next ');
        document.write('\n');
document.write('If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")) Then ');
document.write('\n');
document.write('flashver = 3 ');
document.write('\n');
document.write('End If ');
document.write('\n');
document.write('If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")) Then ');
document.write('\n');
document.write('flashver = 4 ');
document.write('\n');
document.write('End If ');
document.write('\n');
        document.write('\<\/SCRIPT\> ');
        document.write('\n');
}

if (flashver > 2)
{document.write('&lt Flash Version ');
document.write(flashver);
document.write(' detected &gt')};

if (flashver > 3)
{location.href="http://www.assembly-line.co.uk/assemblyline.html"}
else
{location.href="http://www.assembly-line.co.uk/noflash"};

</SCRIPT>

This script was not written by myself... I simply altered it.
ASKER CERTIFIED SOLUTION
Avatar of 68k
68k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial