0 Replies Latest reply on Jun 5, 2008 2:59 AM by jjales

    browser problems with ExtrenalInterface

    jjales
      hello

      I'm trying to make a simple comunication from flex to javascript, and from javascript to flex.
      I manage to do almost everythin right with IE, and the same code fails with firefox when IE succeeds, and conversly succeeds when IE fails.

      more precisely, find here below the mxml code, and the html template.

      the test button for ExternalInterface.available works with both browers

      trying to hack access to javascript with navifateToURL is blocked by both,
      which seems correct. althought, firefox does display the alert message, while IE does not
      (but this is certainly not the concern here I think)

      Now first big problem : the ExternalInterface.addCallback linked to the "enable" button works with IE,
      but raises an error with firefox like :
      SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:/Doc...../bin-debug/test_javascript_interface.swf cannot access file:///C:/Doc.../bin-debug/test_javascript_interface.html.

      I tryed adding explicit allowDomain calls but didnot manage to soleve that issue..
      // flash.system.Security.allowDomain("local");
      // flash.system.Security.allowDomain("file:///");

      once enabled in IE, the html button "js call flex", linked to the exposed function performs well.


      Now the other way around : trying to call js from flex with button in flex linked to ExternalInterface.call
      does work well on IE. and when trying it with firefox, the same message on sandbox violation arises.
      I tryied the same calls to allowDomain, with no better results.


      any clue would be greatly appreciated !


      PS : I'm using IE 6.0.2900... with flash player 9, and firefox 2.0.0.14, with flasj player 9 as well .