Avatar billede sorenrex Nybegynder
26. april 2001 - 14:14 Der er 10 kommentarer og
1 løsning

FLASH PLUGINCHEK

hej jeg skal have checket for flash plugin og hvis plug in ikke findes da skal vælges en gif og ikke starte download af player.
til brug for bannerann.
det haster!!!!! Tak.her er min html:
<HTML>
<HEAD>
<TITLE>gaarde</TITLE>
</HEAD>
<BODY bgcolor=\"#FFFFFF\">
<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\"
ID=gaarde WIDTH=250 HEIGHT=60>
<PARAM NAME=movie VALUE=\"gaarde.swf\"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=exactfit> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src=\"gaarde.swf\" menu=false quality=high scale=exactfit salign=LT bgcolor=#FFFFFF  WIDTH=250 HEIGHT=60 TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED>
</OBJECT>
</BODY>
</HTML>
Avatar billede visionmagic Nybegynder
26. april 2001 - 14:31 #1
Håber denne funker....

/VisionMagic

PS! Du ka evt ændre \'dinflashsite.html\',\'NOflash.html\'
    til: \'gaarde.swf\',\'ditbillede.gif\'

<script language=\"JavaScript\">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf(\'Microsoft\')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf(\'3.1\')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf(\"Flash\")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf(\"Director\")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
<body bgcolor=\"#000000\" onLoad=\"MM_checkPlugin(\'Shockwave Flash\',\'dinflashsite.html\',\'NOflash.html\',false);return document.MM_returnValue\">
<script name=\"Used by MM_checkPlugin\" language=\"javascript\">
<!--
with (navigator) if (appName.indexOf(\'Microsoft\')!=-1 && appVersion.indexOf(\'Mac\')==-1) document.write(\'\'+
\'<scr\'+\'ipt language=\"VBScript\">\\nOn error resume next\\n\'+
\'MM_dir = IsObject(CreateObject(\"SWCtl.SWCtl.1\"))\\n\'+
\'MM_flash = NOT IsNull(CreateObject(\"ShockwaveFlash.ShockwaveFlash\"))\\n</scr\'+\'ipt>\');
//-->
</script>
Avatar billede jakoba Nybegynder
26. april 2001 - 14:34 #2
der er vist ingen 100% sikker test for alle browsere. denne er god.
http://www.moock.org/webdesign/flash/detection/moockfpi/
Avatar billede nikolajdu Nybegynder
26. april 2001 - 15:03 #3
Jakoba har fuldstændigt ret. Det er ikke muligt at tjekke 100% for plugins. Derfor ses ofte en forside i stilen,:\"hvis du kan se denne bold hoppe har du Flash installeret!\".

/Nikolaj
Avatar billede jakoba Nybegynder
28. april 2001 - 00:13 #4
var det dig der ville have et svar?
Avatar billede visionmagic Nybegynder
28. april 2001 - 13:23 #5
Wow, det HASTER *LOLLER*
Avatar billede visionmagic Nybegynder
29. april 2001 - 19:19 #6
jakoba:>
har du glemt??
http://www.eksperten.dk/spm/63890
Avatar billede sukos Juniormester
29. april 2001 - 19:23 #7
Lidt at lege med:




<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">

<HTML>
<HEAD><TITLE>Coca Cola Adventure Quiz</TITLE>

<!-- prevent caching in netscape. very important cause netscape tends to mangle cached code -->
<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">



<SCRIPT LANGUAGE=\"JavaScript\" type=\"text/javascript\">
<!--

// #############################################
// these are the user defined globals
// modify the following variables to customize the inspection behaviour

var requiredVersion = 5;            // version the user needs to view site (max is 5, min is 2)
var useRedirect = true;             // \"true\" loads new flash or non-flash page into browser
                                    // \"false\" embeds movie or alternate html code into current page

// set next three vars if useRedirect is true...
var flashPage = \"goflash_0802.html\"        // the location of the flash movie page
var noFlashPage = \"upgrade.html\"    // send user here if they don\'t have the plugin or we can\'t detect it
var upgradePage = \"upgrade.html\"    // send user here if we detect an old plugin
// #############################################



// *************
// everything below this point is internal until after the body tag
// do not modify!
// *************

// system globals
var flash2Installed = false;        // boolean. true if flash 2 is installed
var flash3Installed = false;        // boolean. true if flash 3 is installed
var flash4Installed = false;        // boolean. true if flash 4 is installed
var flash5Installed = false;        // boolean. true if flash 5 is installed
var maxVersion = 5;                    // highest version we can actually detect
var actualVersion = 0;                // version the user really has
var hasRightVersion = false;        // boolean. true if it\'s safe to embed the flash movie in the page
var jsVersion = 1.0;                // the version of javascript supported

// -->
</SCRIPT>

<SCRIPT LANGUAGE=\"JavaScript1.1\" type=\"text/javascript\">
<!--

// check the browser...we\'re looking for ie/win
var isIE = (navigator.appVersion.indexOf(\"MSIE\") != -1) ? true : false;        // true if we\'re on ie
var isWin = (navigator.appVersion.indexOf(\"Windows\") != -1) ? true : false; // true if we\'re on windows

// this is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// write vbscript detection if we\'re not on mac.
if(isIE && isWin){ // don\'t write vbscript tags on anything but ie win
    document.write(\'<SCR\' + \'IPT LANGUAGE=VBScript\\> \\n\');
    document.write(\'on error resume next \\n\');
    document.write(\'flash2Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.2\"))) \\n\');
    document.write(\'flash3Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.3\"))) \\n\');
    document.write(\'flash4Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.4\"))) \\n\');
    document.write(\'flash5Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.5\"))) \\n\');   
    document.write(\'</SCR\' + \'IPT\\> \\n\'); // break up end tag so it doesn\'t end our script
}
// -->
</SCRIPT>

<SCRIPT LANGUAGE=\"JavaScript\" type=\"text/javascript\">
<!--

// next comes the standard javascript detection that uses the navigator.plugins array
// we pack the detector into a function so it loads before we run it

function detectFlash(){   

    if (navigator.plugins){                                // does navigator.plugins exist?
        if (navigator.plugins[\"Shockwave Flash 2.0\"]     // yes>> then is Flash 2
        || navigator.plugins[\"Shockwave Flash\"]){        // or flash 3+ installed?

            // set convenient references to flash 2 and the plugin description
            var isVersion2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";
            var flashDescription = navigator.plugins[\"Shockwave Flash\" + isVersion2].description;
            // a flash plugin-description looks like this: Shockwave Flash 4.0 r5
            // so we can get the major version by grabbing the character before the period
            // note that we don\'t bother with minor version detection. do that in your movie with $version
            var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(\".\") - 1));

            // we know the version, now set appropriate version flags
            flash2Installed = flashVersion == 2;       
            flash3Installed = flashVersion == 3;
            flash4Installed = flashVersion == 4;
            flash5Installed = flashVersion == 5;
        }
    }
   
    // loop through all versions we\'re checking, and set actualVersion to highest detected version
    for (var i = 2; i <= maxVersion; i++) {   
        if (eval(\"flash\" + i + \"Installed\") == true) actualVersion = i;
    }
    // if we\'re on webtv, the version supported is 2 (pre-summer2000, or 3, post-summer2000)
    // note that we don\'t bother sniffing varieties of webtv. you could if you were sadistic...
    if(navigator.userAgent.indexOf(\"WebTV\") != -1) actualVersion = 2;   
   
    // uncomment next line to display flash version during testing
    // alert(\"version detected: \" + actualVersion);


    // we\'re finished getting the version. time to take the appropriate action

    if (actualVersion >= requiredVersion) {         // user has a new enough version
        hasRightVersion = true;                        // flag: it\'s okay to write out the object/embed tags later

        if (useRedirect) {                            // if the redirection option is on, load the flash page
            if(jsVersion > 1.0) {                    // need javascript1.1 to do location.replace
                window.location.replace(flashPage);    // use replace() so we don\'t break the back button
            } else {
                window.location = flashPage;        // otherwise, use .location
            }
        }
    } else {    // user doesn\'t have a new enough version.
   
        if (useRedirect) {        // if the redirection option is on, load the appropriate alternate page
            if(jsVersion > 1.0) {    // need javascript1.1 to do location.replace
                window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
            } else {
                window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
            }
        }
    }
}


detectFlash();    // call our detector now that it\'s safely loaded.   
   
// -->
</SCRIPT>





</HEAD>

<BODY BGCOLOR=\"#FFFFFF\">

<!--############################################################
    IF YOU\'RE USING PAGE REDIRECTION, FOLLOW THESE INSTRUCTIONS
    1) put some content here to tell the user what\'s going on
    while they wait. something like:
    \"detecting macromedia flash, please wait...\"

    2) delete everything below this point up to
    the end body tag </BODY>
    ############################################################-->



   
   
<!--############################################################################
    IF YOU\'RE USING CONTENT SWAPPING, ADJUST THE SCRIPT BELOW TO SUIT YOUR NEEDS
    ############################################################################-->


<NOSCRIPT>
<!--############################################################################
    HERE WE PROVIDE ALTERNATE CONTENT FOR NON-SCRIPT-SUPPORTING BROWSERS
    OR BROWSERS THAT HAVE THEIR SCRIPTING TURNED OFF...
    ############################################################################

    IF YOU ARE USING PAGE REDIRECT, A META REFRESH GOES HERE. FOR EXAMPLE:

    <META HTTP-EQUIV=\"Refresh\" CONTENT=\"10;URL=upgrade.html\">
   
        -->
</NOSCRIPT>


</BODY>
</HTML>
Avatar billede nikolajdu Nybegynder
30. april 2001 - 06:52 #8
Hey Søren.

Var lidt rundt og fandt den her. Har ikke tjekket om den virker, men det ligner det du søger. Dog skal du have ændret

navigator.plugins[\"Shockwave Flash 2.0\"])

til nummeret på den player version du vil have f.eks

navigator.plugins[\"Shockwave Flash 4.0\"])

http://www.builder.dk/artikler/article.asp?AID=29
Avatar billede spacey Nybegynder
07. maj 2001 - 21:58 #9
Er der nogen særlige grunde til at de scripts i poster er på længde med samtlige af mosebøgerne, eller lukkeloven med minesterialtidende og tillæg???

Det kan gøres langt mere simpelt, prøv

<script language=\"Javascript\">   
<!--

if ( navigator.mimeTypes && navigator.mimeTypes[\"application/x-shockwave-flash\"] && navigator.mimeTypes[\"application/x-shockwave-flash\"].enabledPlugin  && navigator.plugins && navigator.plugins[\"Shockwave Flash\"] ){
    document.location.href = \"flash-siden.html\"
} else {
    document.location.href = \"uden-flash.html\"
}

//-->   
</SCRIPT>


Denne sender flash brugere til den ene side hvor du så viser flashfilmen, og ikke flash brugere til en anden side hvor du viser gif\'en...
Avatar billede sorenrex Nybegynder
08. maj 2001 - 08:05 #10
-->spacey
det ser ud som det jeg tænkte. Hader romaner too!
Har jeg forstået at det checker for player tilstæde og ikke version. Jeg skal bruge enten eller udgaven
Avatar billede sorenrex Nybegynder
08. maj 2001 - 08:16 #11
--> nikolajdu 
Det ser nu heller ikke helt tosset ud prøver det senere
tak, tak
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester