1 Reply Latest reply on Jun 4, 2009 9:46 AM by Joe ... Ward

    Engage bridge

    Saka Nurudeen Level 1

      Hi eveybody!

       

      I have a serious problem :

      My adobe application has an initial  page called init.html :

      <script src="./lib/adobe/AIRAliases.js" type="text/javascript"></script>

      <script type="text/javascript" src="init.js"></script>

      </head>
      <body onload="showFTA()">
      <iframe id="home" style="width: 99.5%; height: 99.5%" src = "http://localhost:8080/G550/home.html"></iframe>
      </body>
      </html>

      I declared a function in script init.js :

      function engageBridge() {

       

          air.trace('start engageBridge');
          home = document.getElementById("home");
          home.contentWindow.parentSandboxBridge = new Object();
          home.contentWindow.parentSandboxBridge.trace = air.trace;
          home.contentWindow.parentSandboxBridge.URLRequest = air.URLRequest;
          air.trace('finish engageBridge');
      }

      the function showFTA() calls function engageBridge()

       

      home.html source code is :

      <script type="text/javascript">

      function testBridge() {

          parentSandboxBridge.trace('Coucou Nurudeen');
          var test = new parentSandboxBridge.URLRequest("http://wwww.google.fr");

      }

      </script>

      </head>
      <body onload="testBridge()">

      TEST BRIDGE

      </body>
      </html>

       

       

      After loading home page if i call the function parentSandboxBridge.trace

      it works fine, but if i declare var test = new parentSandboxBridge.URLRequest("http://www.google.fr"),

      console prints :  TypeError: Error #1007: Instantiation attempted on a non-constructor.

      What's wrong ? How to resolve ?

       

      Please help.