3 Replies Latest reply on Dec 23, 2007 9:39 AM by Adam Adamczyk

    AIR app communnicating with External App

    Slim222 Level 1
      I would like to make my AIR app communicate with another application that's running on the desktop. What are the best ways to do this?

      Ideally I'm looking to call functions inside the AIR app from a separate program, and vice versa. This is in fact possible using the ExternalInterface capability, however, this is only available when the separate application is an ActiveX container (such as the browser), and thus contains the FlashPlayer ActiveX control within it. But what if your AS3 application doesn't just run inside the FlashPlayer but requires the AIR runtime instead? There doesn't seem to be any way that an external app. can talk to an AIR app the way it can call functions on the FlashPlayer.

      My reasons for needing this are that while AS3 is great, especially for creating an interactive interface, there are still some low-level things which must be coded in another language.

      Any thoughts that anyone has on this topic would be greatly appreciated.
        • 1. Re: AIR app communnicating with External App
          sasbrw Level 1
          I have a related question. Can an ActionScript program running inside the Flash player call a Windows DLL? --Bruce
          • 2. Re: AIR app communnicating with External App
            Slim222 Level 1
            Hi Bruce,

            In theory, you can do what you want, but it is an indirect way of achieving it, and there are some performance/functional issues.

            You can make a windows application that is an ActiveX control container, and put the FlashPlayer control inside it. Handle the "FlashCall" event in your windows program (this is fired when your swf calls a custom external function), and then you can use it to load and call whatever .dll function you want.

            In practice, from what I've observed, there are some limitations. The graphics performance of the FlashPlayer suffers when embedded this way in a Windows app. Also, if you want to call into the flashplayer sometimes the function calls fail. Having said this, my experience is limited to AS2 implementations; maybe things have improved with AS3.

            Anyway, hope this helps. Would be interested to hear your observations if you should try this route.

            Ed
            • 3. Re: AIR app communnicating with External App
              Adam Adamczyk Level 1
              You can integrate normal Flex application with typical windows program/library but unfortunately AIR does not allow you call function by ExternalInterface API. ExternalInterface API class is not supported in AIR applications.

              I wrote some examples how to integrate windows application by emebeding flex application as container.

              see

              Populate Adobe Flex with ADO Recordset

              Passing XML to Flex by ExternalInterface