4 Replies Latest reply on Feb 9, 2009 6:14 AM by Newsgroup_User

    External interface.call is not working

    Level 1
      hi, i am trying to call one java script function in actionscript by using External interface.call method. but its not working .can u pls tell me why this happend
        • 1. Re: External interface.call is not working
          Level 7

          "angadala" <webforumsuser@macromedia.com> wrote in message
          news:gmp9im$dam$1@forums.macromedia.com...
          > hi, i am trying to call one java script function in actionscript by
          > using External interface.call method. but its not working .can u pls tell
          > me why this happend

          Not without seeing some code


          • 2. Re: External interface.call is not working
            tagyro Level 1

            ... else {
            trace('no external interface')
            }
            • 3. Re: External interface.call is not working
              Level 1
              skill status.mxml


              <mx:Script>
              <![CDATA[
              if (ExternalInterface.available) {
              ExternalInterface.call(getDataFromXml);
              }

              it is javascript
              <script type="javascript">
              var data = new Array();
              data[0]=[1,2,3];
              function getData()
              {
              return data;
              }
              </script>
              </head>
              <body>
              <div id="SkillStatus">
              <p>Alternative content</p>
              </div>

              </body>
              </HTML>
              • 4. Re: External interface.call is not working
                Level 7

                "angadala" <webforumsuser@macromedia.com> wrote in message
                news:gmpc58$g9p$1@forums.macromedia.com...
                > skill status.mxml
                >
                >
                > <mx:Script>
                > <![CDATA[
                > if (ExternalInterface.available) {
                > ExternalInterface.call(getDataFromXml);
                > }
                >
                > it is javascript
                > <script type="javascript">
                > var data = new Array();
                > data[0]=[1,2,3];
                > function getData()
                > {
                > return data;
                > }
                > </script>
                > </head>
                > <body>
                > <div id="SkillStatus">
                > <p>Alternative content</p>
                > </div>
                >
                > </body>
                > </HTML>
                >

                1) Your JavaScript function name and the function name you are calling
                don't match.
                2) On the Flex side, you are calling a JS function that I think you are
                expecting to return a value, but not assigning the result of the value to a
                function.