1 Reply Latest reply on Oct 14, 2009 4:39 AM by The Flex Viking

    How to add JavaScript to rendered form

    PetrKucera Level 1



          I have Flex application with ExternalInterface.call() command by which I call function in JS on its HTML page, i.e.

      part of a flex app code:

      private function callJS():void{ ExternalInterface.call("sendMSG", "Flex app message: ".concat(txt.text)); }


      part of a html:


      <script language="JavaScript" type="text/javascript">
          function sendMSG(msg){ alert(msg); }



      But when I rendered the swf as Form in ALC, I get any html with reference to the swf (see bellow) but I don't know, howand where I can put the JS code with the function. I placet it in head space, but it was malfunction.


           Thanks for any answer




        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta http-equiv="Cache-Control" Content="no-cache"/>
        <meta http-equiv="Pragma" Content="no-cache"/>
        <meta http-equiv="Expires" Content="-1"/>


        <title>Adobe LiveCycle ES Form Guide</title>
        <script id="guideInitScript" name="guideInitScript" language="JavaScript" type="text/javascript">
          var WrapperVersion      = "2.0";


          var WantToDebug         = 0;
          var WantPdfPreview      = 1;


          var SWFURL            = "http://...";
          var PDFURL            = "http://...";
          var XdpData             = "...";
          var GuideDefinition     = "";


          var GuideName           = "";
          var GuideLocale        = "en_US";
          var GuideSubmitAll        = "false";


          var BaseUrl             = "@@baseUrl@@";
          var RootData            = "@@rootData@@";


          var playerInstallURL    = "http://...";