views:

17

answers:

1

I have two web applications written in Flex I would like to integrate. I would like one Flex app (let's call it application A) to invoke second Flex app (let's call it application B). Application A has access only to swf file of application B (not source code). When application A invokes application B, it should be able to pass some data to application B. After application B is invoked it should be able to pass some data back to application A. These two applications will be hosted on the same server, but will use different server code.

The easiest way of implementing this (or one of the ways to be more precise) would be to have UI element on app A (button, link, menu item, etc) that would invoke app B. But in that case, two Flex applications couldn't communicate directly (since only one is active at a time), and they would have to communicate through server code, which is something I would like to avoid.

In short application A should invoke application B, pass some data to it. Application B should do it's work, display some content, and have a mean of passing some data back to application A.

I'm aware of LocalConnection, and I've seen similar question, but in that case I would have to have both application in the same browser window. This would be acceptable to some extend, but only if app B is contained in app A (not if they are both on the same HTML page). Would LocalConnection work in that case?

Do you have any recommendations on how to implement this kind of communication?

+1  A: 

You can use a LocalConnection to communicate directly between two web based SWFs. There should be no limitation that both apps are in the same browser window. They just both have to be running on the same machine.

I'm not sure exactly what you mean by having one Flex app invoke the second. But, you should be able to use NavigateToURL to load another page. I believe it supports new windows, which would effectively be one app launching another. You might be also able to mock something up with iFrames and ExternalInterface.

www.Flextras.com