View Full Version : Open another mxml application

01-20-2009, 12:55 PM

I need an Idea for the below two .Please guide me.

I have two flex projects P1 and P2.
P1 has five compnents A,B,C,D,E
P2 has only one mxmlapplication mainpage.

Here am working with asp.net webservice.

When i click one linkbutton of component A in P1,it will access the webservice with inputs and the result need to be display in P2's mainpage whick contains a gridcontrol.
Is it possible?If it possible please show me the way.or give me any referrence.

else the above case , when i click the linkbutton the result need to be display in another htmlexplorer.ie when i click the linkbutton , another one website need to be open automatically with the webservice result.

please show me the way.


01-20-2009, 02:34 PM
If you are working with two .swf's, whether in AIR, Flex, Flash, etc, you can use the LocalConnections class to interface between the two of them, if they are running on the same machine. If they are running on two machines on a network, you will have to either use XMLSocket or simply call systematic URLRequests (using setIntervals or setTimeouts).

To get a LocalConnection to work in AS3:

var conn:LocalConnection = new LocalConnection();
conn.connect( "myConnectionName" ); // A "channel" for this connection to listen to.
// All .swf's on the same channel will receive
// all of these commands.

function myMethod( ...args:Array ):void
trace( "myMethod works!!! The parameters are: " );
trace( arguments ); // A special array of all of the arguments.

On the other swf, put the following:

var conn:LocalConnection = new LocalConnection();
conn.send( "myConnectionName", "myMethod", 1, 2, "argument", "foo" ); // as many arguments as you want.