how to detect flash using asp.net (vb.net)

My problem is that I have flash on several of my asp.net pages and for broswers like firefox which are not able to display flash, I want to give a friendly message or a link to download the same.
how can I detct flash using asp.net code and display the message accordingly.
sjosh1Asked:
Who is Participating?
 
David H.H.LeeCommented:
Hi sjosh1,
You can refer Adobe Flash Player Detection Kit. Download the zip files for the integration that you need:
http://www.adobe.com/products/flashplayer/download/detection_kit/

Or,
Use third party component to achieve the required:
http://www.cyscape.com/products/bhawk/workshop/detect-flash.aspx?bhcp=1
0
 
sjosh1Author Commented:
Thanks for your suggestions.
Am actually working on the adobe detection kit javascript solution and it seems to work only if I can provide the exact version of the flash file which am unable to (as it was sourced from a 3rd party and is located at their website).
0
 
David H.H.LeeCommented:
Have you tried the solution that provided in folder - Client-Side Detection?
Please provide more details on your current script if need for further inspection.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sjosh1Author Commented:
yes I am using their client side detection script.
In the html provided, there's a funtion as follow in which we need to provide the value of the gloabal variable requiredMajorVersion. Correct me if I am wrong but I am assuming this requiredMajorVersion is the version in which the fash file was created?  :

<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;
       // -----------------------------------------------------------------------------
       // 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", "400",
           "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"
           );*/
           document.getElementById("flash").style.display = 'block';
           document.getElementById("noflash").style.display = 'none';

       } else {  // flash is too old or we can't detect the plugin
           /* var alternateContent = 'You are not able to view the flash file.<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*/
           document.getElementById("flash").style.display = 'none';
           document.getElementById("noflash").style.display = 'block';

       }
// -->

As you will notice, I have changed the function to suit my needs. If the flash test passes, I display the div containing flash, else the div containing alternate text.
0
 
sjosh1Author Commented:
Found the version. My code's working fine now though I need to do a lot of testing.
Thanks again.
0
 
sjosh1Author Commented:
Would you know of an alternative asp.net solution?
0
 
David H.H.LeeCommented:
Glad to hear the resolved.

>>an alternative asp.net solution?
You can just invoke this in client script as suggested in Adobe Flash Player Detection Kit. Do you have any obstacle to apply this on asp.net solution?Yet, it is depending your applicable flow in this case.
0
 
sjosh1Author Commented:
I didn't have any problems with it in my asp.net solution though just wanted to find out a server side solution for it in asp.net
0
 
David H.H.LeeCommented:
You can put all the detection code above into one client script function called - "loadFlashDetection()". Then, invoke this script in Page_Load event or your preferred server event as needed.
eg:
Sub Page_Load
  if not ispostback then
    RegisterStartupScript("loadFlash", "<script>loadFlashDetection();</" & "script>")
 end if
end sub
0
 
sjosh1Author Commented:
Thanks for that though I cannot put it in page load event because otherwise it does not recognize my page divs and keeps giving an error message like object not found for the divs and so I have to put it at the bottom of the page under the actual divs for each page.

Also, just to be very clear, with regards to asp.net script, I was actually referring to whether we have an equivalent in asp.net for the asp flash detection script (example: if isObject(createObject("shockwaveFlash.shockwaveFlash))
0
 
David H.H.LeeCommented:
>>Also, just to be very clear, with regards to asp.net script, I was actually referring to whether we have an equivalent in asp.net for the asp flash detection script (example: if isObject(createObject("shockwaveFlash.shockwaveFlash))
Perhaps you can use third party component like BrowserHawk (as suggested earlier). But, you may need to purchase some money for this commercial tool.
0
 
sjosh1Author Commented:
Thanks so much for all your help on this topic.
0
 
David H.H.LeeCommented:
You are welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.