5 Replies Latest reply on Aug 3, 2009 8:41 PM by haibin_sh

    ExternalInterface.call returns null in IE even when the function is available

    haibin_sh Level 1

      Hi,

       

      I have a question here about ExternalInterface.

       

      In MXML, I have

       

       

       

       

      var result1:String = ExternalInterface.call("isValidRegExp1", string);

       

       

       

       

       

       

      if (result1 == null) {

       

           trace("result1 is null");

       

           throw new Error("isValidRegExp1 error");

      } else {

       

           trace("result1: " + result1);

      }

       

      In HTML, I have

       

      <script>

           function isValidRegExp1(regexpString)

           {

                alert('isValidRegExp1')

                return "haibin"

           }

      </script>

       

      I test it in FireFox and see the alert window and "result1: haibin" in log file. But in IE, I see the alert window and "result1 is null" in log file.

       

      The document says "If the function is not available, the call returns null" Any idea why IE returns null even when the function is called?

       

       

       

      Regards,

      Haibin