0 Replies Latest reply on Jun 9, 2006 8:16 AM by mgilvey_IPG

    Flash Detection Kit Help (Java Script version)

    mgilvey_IPG Level 1
      Greetings,

      I recently downloaded the Adobe Flash Detection Kit and I have decided to use the "Client-Sid Scripting to Detect the Flash Player Version" urm version (page 6 of the PDF). I have opened the accompanying HTML file "ClientSidDetection.html" and copy/pasted the script (lines 6 - 19) into the head of my document. Here is that code:

      <script src="AC_OETags.js" language="javascript"></script>
      <script language="JavaScript" type="text/javascript">
      <!--
      // -----------------------------------------------------------------------------
      // Globals
      // Major version of Flash required
      var requiredMajorVersion = 8;
      // Minor version of Flash required
      var requiredMinorVersion = 0;
      // Minor version of Flash required
      var requiredRevision = 0;
      // -----------------------------------------------------------------------------
      // -->
      </script>

      Then I copy/pasted lines 23 - 53 into the body:

      <script language="JavaScript" type="text/javascript">
      <!--
      // Version check based upon the values entered above in "Globals"
      var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

      // Check to see if the version meets the requirements for playback
      if (hasReqestedVersion) {
      // if we've detected an acceptable version
      // embed the Flash Content SWF when all tests are passed
      AC_FL_RunContent(
      "src", "example",
      "width", "550",
      "height", "200",
      "align", "middle",
      "id", "detectionExample",
      "quality", "high",
      "bgcolor", "#FFFFFF",
      "name", "detectionExample",
      "allowScriptAccess","sameDomain",
      "type", "application/x-shockwave-flash",
      'codebase', ' http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
      "pluginspage", " http://www.adobe.com/go/getflashplayer"
      );
      } else { // flash is too old or we can't detect the plugin
      var alternateContent = 'Alternate HTML content should be placed here.<BR>'
      + 'This content requires the Adobe Flash Player. '
      + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
      document.write(alternateContent); // insert non-flash content
      }
      // -->
      </script>

      All this, I put on the same page as the content I want to display, an SWF and an SWF that loads an FLV. I clicked F12 and noticed that it was loading an SWF that says I have the plugin. After going into the code I noticed wher this file was coming from, lines 28 - 45:

      // Check to see if the version meets the requirements for playback
      if (hasReqestedVersion) {
      // if we've detected an acceptable version
      // embed the Flash Content SWF when all tests are passed
      AC_FL_RunContent(
      "src", "example",
      "width", "550",
      "height", "200",
      "align", "middle",
      "id", "detectionExample",
      "quality", "high",
      "bgcolor", "#FFFFFF",
      "name", "detectionExample",
      "allowScriptAccess","sameDomain",
      "type", "application/x-shockwave-flash",
      'codebase', ' http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
      "pluginspage", " http://www.adobe.com/go/getflashplayer"
      );

      I don't want this to load here. What I would like to happen is when the user arrives at the site, their browser is checked, if they have it, the page displays if not then they are taken to a separate page on the same site that has a link to the get flash download page on Adobe's site.

      Here is the test page:

      Please help WEBSITE

      The code I mentioned above with line numbers are the line numbers in the Adobe file, not this page that I built. On this page they are as follows:

      JS THAT IS IN HEAD:
      Lines 5 - 18

      JS THAT IS IN BODY
      Lines 75 - 105

      Please help.