header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
neeru
Points:0
Posts:0

8/30/2010 10:03:59 PM

Title: check abobe reader is installed in computer


Hi.
I want to check in my computer adobe reader software is installed or not in action script 3.0.
Example: Suppose adobe reader software is not installed in pc then massage show “adobe reader is not available”. If adobe reader software is already installed. Then massage show “adobe reader is already available
Tell the logic in oop s language (action script 3.0).



1
Dave
Points: 970
Posts:1
8/30/2010 10:33:15 PM



Flash does support detection of any other plugin than flash player. You can use the below JavaScript to detect the version of Acrobat plugin in html page . Also you can call this JavaScript from flash using externalInterface class and get back the result to show the message flash. Here is the script


<script type="text/javascript">
var acrobat=new Object();
acrobat.installed=false;
acrobat.version='0.0';
 
if (navigator.plugins && navigator.plugins.length){
  for ( var x = 0, l = navigator.plugins.length; x < l; ++x ) {
    if (navigator.plugins[x].description.indexOf('Adobe Acrobat') != -1 || navigator.plugins[x].description.indexOf('PDF') != -1) {
      acrobat.version=(navigator.plugins[x].description.indexOf('PDF')!=-1)?'7+':parseFloat(navigator.plugins[x].description.split('Version ')[1]);
      if (acrobat.version.toString().length == 1) acrobat.version+='.0';
      acrobat.installed=true;
      break;
    }
  }
}
else if (window.ActiveXObject) {
  for (x=2; x<10; x++) {
    try {
      oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
      if (oAcro) {
        acrobat.installed=true;
        acrobat.version=x+'.0'; 
      }
    }
    catch(e) {}
  }
  try {
    oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
    if (oAcro4) {
      acrobat.installed=true;
      acrobat.version='4.0';
    }
  }
  catch(e) {}
  try {
    oAcro7=new ActiveXObject('AcroPDF.PDF.1');
    if (oAcro7) {
      acrobat.installed=true;
      acrobat.version='7+';
    }
  }
  catch(e) {}
}
 
alert (acrobat.version);
</script>


2
Warrior
Points: 420
Posts:0
8/31/2010 12:14:33 PM



Flash cant detect PDF plugin.
Dave good code , keep it up


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions