Estimados
llego hasta ustedes para pedir ayuda. Estoy tratando de hacer una aplicación de escritorio con AIR DE FLEX4, esta consiste en hacer un registro de clientes insertando su huella digital, el dispositivo que estoy utilizando para poder capturar la huella digital es el HAMSTER IV DE SecuGen. El dispositivo trae unos ejemplos y hay uno en html que tiene un JacaScript incrustado, el cual al ejecutarlo del Navegador web se ejecuta sin ningún problema, uno aprieta un boton el capturar y se abre el software que trae por defecto el SecuGen y Wow!!! impecable, lee sin ningún problema. Aqui viene el problema, creé una aplicación flex AIR, inserté el html que tiene su respectivo Javascript que hace la funcion de abrir el dispositivo y su respectivo software de captura. Compilé y heché a andar, pero al apretar el boton para capturar lamentablemente no abre el dispositivo, me arroja un error "Value undefined does not allow function calls" o sea valor no definido que no ermite la llamada a funciones.
En primera instancia solo quiero capturar la huella digital y despues guardar los parametros que me entrega en una Sqlite.
Por favor pido si alguien sabe mas del tema me sea guiando y podamos establecer y desarrollar esto a veneficio de todos.


Os dejo el codigo del html con el javascript insertado y el mxml de flex AIR.

prueba.html

Código HTML :


<html>
   
   
   <script language="Javascript" >
      
      function fnRegister()
      {   
         var err, payload
         
         try // Exception handling
         {
            
            
         
            DEVICE_FDU04      = 4;
            DEVICE_AUTO_DETECT   = 255;
            
            
            document.objSecuBSP.OpenDevice(DEVICE_AUTO_DETECT);
            err = document.objSecuBSP.ErrorCode;
            
            // Enroll user's fingerprint.
            document.objSecuBSP.Enroll(payload);
            err = document.objSecuBSP.ErrorCode;   // Get error code
         
            if ( err != 0 )      // Enroll failed
            {
               alert('Registro Fallido ! Error Number : [' + err + ']');
               return;
            }
            else   // Enroll success
            {
               // Get text encoded FIR data from SecuBSP module.
               document.bspmain.template1.value = document.objSecuBSP.FIRTextData;
               alert('Registro Satisfactorio !');
            }
         
               
            
                  
            // Open device. [AUTO_DETECT]
            // You must open device before enrollment.
         
            DEVICE_FDU04      = 4;
            DEVICE_AUTO_DETECT   = 255;
            
            document.objSecuBSP.OpenDevice(DEVICE_AUTO_DETECT);
            err = document.objSecuBSP.ErrorCode;   // Get error code
         
            if ( err != 0 )      // Device open failed
            {
               alert('Fallo al abrir el Dispositivo !');
               return;
            }
         
            // Enroll user's fingerprint.
            document.objSecuBSP.Enroll(payload);
            err = document.objSecuBSP.ErrorCode;   // Get error code
         
            if ( err != 0 )      // Enroll failed
            {
               alert('Registro Fallido ! Error Number : [' + err + ']');
               return;
            }
            else   // Enroll success
            {
               // Get text encoded FIR data from SecuBSP module.
               document.bspmain.template1.value = document.objSecuBSP.FIRTextData;
               alert('Registro Satisfactorio !');
            }
         
            // Close device. [AUTO_DETECT]
            document.objSecuBSP.CloseDevice(DEVICE_AUTO_DETECT);
            
      
         }
         catch(e)
         {
            alert(e.message);
         }
         
         return;
      }
      
      
function fnCapture()
{   
   var err
   
   try // Exception handling
   {
      alert("PASA");
      // Open device. [AUTO_DETECT]
      // You must open device before capture.
   
      DEVICE_FDU04      = 4;

      DEVICE_AUTO_DETECT   = 255;
   
      document.objSecuBSP.OpenDevice(DEVICE_AUTO_DETECT);
      err = document.objSecuBSP.ErrorCode;   // Get error code
   
      if ( err != 0 )      // Device open failed
      {
         alert('Error al abrir dispositivo !');
         return;
      }
         
      // Enroll user's fingerprint.
      document.objSecuBSP.Capture();
      err = document.objSecuBSP.ErrorCode;   // Get error code
   
      if ( err != 0 )      // Enroll failed
      {
         alert('Error al Capturar ! Error Numero : [' + err + ']');
         return;
      }
      else   // Capture success
      {
         // Get text encoded FIR data from SecuBSP module.
         document.bspmain.template2.value = document.objSecuBSP.FIRTextData;
         alert('Captura Satisfactoria !');
      }
   
      // Close device. [AUTO_DETECT]
      document.objSecuBSP.CloseDevice(DEVICE_AUTO_DETECT);

   }
   catch(e)
   {
      alert(e.message);
   }
   
   return;
}

function fnVerify()
{   
   var err
   var str1 = document.bspmain.template1.value;
   var str2 = document.bspmain.template2.value;
   
   try // Exception handling
   {
      // Verify fingerprint.
      document.objSecuBSP.VerifyMatch(str1, str2);
      err = document.objSecuBSP.ErrorCode;
   
      if ( err != 0 )
      {
         alert('Error de Verificacion ! Error Numero : [' + err + ']');
      }
      else
      {
         if ( document.objSecuBSP.IsMatched == 0 )
            alert('Verification failed !');
         else
            alert('Verificacion Satisfactoria !');
      }
   }
   catch(e)
   {
      alert(e.message);
   }
   
   return;
}

      
      
    </script>
    
    <body>
      <h1>::: PRUEBA JS :::</h1><br/><br/>
        
<form name=bspmain>

<input type=button name=btnRegister value='Register' OnClick='fnRegister();' style='width:100px'>
<br/>


<input type=text name=template1 style='width:500px'>
<br/>
<br/>
<input type=button name=btnCapture value='Capture' OnClick='fnCapture();' style='width:100px'>
<br/>
<input type=text name=template2 style='width:500px'>
<br/>
<br/>
<input type=button name=btnVerify value='Verify' OnClick='fnVerify();' style='width:100px'>
</form>        
        
        
        
<OBJECT id="objSecuBSP" style="LEFT: 0px; TOP: 0px" height="0" width="0" 
   classid="CLSID:6283f7ea-608c-11dc-8314-0800200c9a66" 
   name="objSecuBSP" >
</OBJECT>   
        
    </body>
</html>






Código Mxml de Flex AIR pruebaJS.mxml

Código Flex :

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                  xmlns:s="library://ns.adobe.com/flex/spark" 
                  xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()" height="530" width="800">
   
   <fx:Script>
      <![CDATA[
         private function init():void{
            html.location = "prueba.html";
         }
         
         private function llamarJS( ):void {
            html.htmlLoader.window.fnRegister(); //Hago la llamada en primera instancia a esta funcion del Javascript a modo de prueba, si funciona esta despues instrodusco el resto de codigo.
         }
      ]]>
   </fx:Script>
   
   
   
   <mx:HTML id="html" x="112" y="49" width="619" height="471"/>   
   
   
   
</s:WindowedApplication>


Por favor Ayudenme o Guienme.
Esperando una buena respuesta, cafeheco.