WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Please help, Javascript for flash 9 detection advice. (1 post)

  1. jamesb4551
    Member
    Posted 5 years ago #

    If inserted in the header.php in <?php wp_head(); ?> would this be the correct scripting to detect the flash player version is of 9 if so, what prompts the mto goto the correct version download?

    <script>
    function getFlashVersion(){
    // ie
    try {
    try {
    // avoid fp6 minor version lookup issues
    // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
    var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
    try { axo.AllowScriptAccess = 'always'; }
    catch(e) { return '6,0,0'; }
    } catch(e) {}
    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
    // other browsers
    } catch(e) {
    try {
    if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
    return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
    }
    } catch(e) {}
    }
    return '0,0,0';
    }

    var version = getFlashVersion().split(',').shift();
    if(version < 9){
    alert("Lower than 9");
    }else{
    alert("9 or higher");
    }
    </script>

    many thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.