6 Replies Latest reply on Mar 21, 2008 2:15 AM by vsava

    Interaction between two AIR applications

    vsava Level 1
      I have one question.
      Is it possible to throw event in one application and catch it in another(both of them run on the same PC).
      If answer is yes, please tell me how.
        • 1. Re: Interaction between two AIR applications
          Oliver Goldman Adobe Employee
          Yes, via LocalConnection. (See the docs for details.)

          Oliver Goldman | Adobe AIR Engineering

          • 2. Re: Interaction between two AIR applications
            vsava Level 1
            Thanks for reply.
            But seems I didn't explain exactly what I want to do. So.
            I have two application. They comunicate using LocalConnection. Is it possible to add event listener at 1st app that will hahdle event that fires at 2nd app? I'm talking about custom events. For example at 1st app I need to listen Button Click event. Button is at 2nd app.

            Thanks ahead
            • 3. Re: Interaction between two AIR applications
              enorton@adobe Adobe Employee

              LocalConnection is the best means for communication between the 2 apps. You cannot have one app listen to the events in another app, but it can receive something from the other app via LocalConnection. The other app should send somthing via LocalConnection during it's handling of the event. When the one app receives that, it can do what it wants.

              So, 1st app is ready to receive something via LocalConnection. The 2nd app has a Button listening for the click, and clickHandler function happens on the click. In the clickHanlder function, send something using LocalConnection.

              I hope that helps!
              • 4. Interaction between two AIR applications
                vsava Level 1
                Hi Erica!
                Thank you for helping me
                Via LocalConnection object I can call some method in other app, but when it runs(e.g. 1 minute) I have to wait for responce. Using event this method could be called as reaction and I can be free for performing some other actions in my 1st app while 2nd is busy.

                In documentation for Flex by following link

                I found next text:
                Components have built-in events that you can handle in ActionScript blocks in your MXML applications. You can also take advantage of the Flex event system's dispatcher-listener model to define your own event listeners outside of your applications, and define which methods of your custom listeners will listen to certain events. You can register listeners with the target object so that when the target object dispatches an event, the listeners get called.

                Maybe you can give me some link where I can find description how It's possible to do.

                • 5. Re: Interaction between two AIR applications
                  matthew horn Level 3
                  Sorry, that text is a little misleading. It means that you can define the listeners outside of the main application file (such as in a class). It has nothing to do with sharing event handlers across applications. I'll reword it for the next release. Thanks,

                  matt horn
                  flex docs
                  • 6. Re: Interaction between two AIR applications
                    vsava Level 1
                    Thank you very much!