0 Replies Latest reply on Jun 27, 2008 1:23 AM by softlab

    AS/MXML method calling through FABridge

    softlab
      Hi all,
      this is my structure:

      index.html
      index.mxml
      my_comp.mxml

      the method I want start is defined in my_comp.mxml
      the FABridge is defined in index.mxml
      this is mi index.html:

      <html>
      <head>
      <title>
      EasyLexWE
      </title>
      <style>
      body {
      margin: 0px;
      overflow:hidden
      }
      </style>
      <script language="JavaScript" type="text/javascript" src="bridge/FABridge.js">
      </script>
      <script language="JavaScript" type="text/javascript">
      var flex_application;

      FABridge.addInitializationCallback("fabridge_1", init);

      function init() {
      flex_application=FABridge.fabridge_1.root();
      }

      function download(document_path) {
      document.download_applet.download(document_path);
      var download_path=new String(document.download_applet.download_path);
      flex_application.my_comp.my_method(download_path.toString());
      }
      </script>
      </head>
      <body>
      <object id="flex_application" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" height="100%" width="100%">
      <param name="src" value="index.swf"/>
      <embed name="flex_application" pluginspage=" http://www.macromedia.com/go/getflashplayer" src="index.swf" height="100%" width="100%"/>
      </object>
      <applet name="download_applet" codebase="/EasyLexWE/" archive="elwe_applet.jar" code="elwe.applet.DownloadApplet.class" width="100%" height="100%">
      </applet>
      </body>
      </html>

      Now I'm not able to start my_method(), otherwise if I define the FABridge directly in my_comp.mxml as in this call:

      flex_application.my_method(download_path.toString());

      all works fine!
      In other word flex_application JS object is not able to navigate through MXML objects structures... is possible to define multiple FABridge? Any suggestion?
      Thanks in advance and regards
      Matt