views:

648

answers:

1

hi there

i need to connect to two different domains from a single flex application. the problem is the domain other than the current hosted domain is unable to login.

letz say i hosted the application at LOCAL server. im able to login to the local server . From the existing application i need a login to the MAIN server too. The problem comes up here.

flash security is not allowing login to MAIN server. in crossdomain we allow-access-from MAIN server. but i want access to the MAIN server from LOCAL server.

is ther nything i need to put extra in crossdomain.xml ?

plz i need a solution!!

ThnQ Sris

A: 

You need to put a crossdomain.xml on your "MAIN" server and allow-access-from "LOCAL"; you don't need to put a crossdomain.xml on the server where your SWF is hosted. The cross domain file is intended to be placed on a 3rd party server to indicate that SWFs hosted from particular domains have permission to access its services.

Another short explanation is here:

http://www.flexafterdark.com/docs/Flash-CrossDomain

cliff.meyers
hi brd6644thanx 4 d response.i did it as u saidi got an exception saying: Security sandbox violation .. swf file at LOCAL server cud not load MAIN server's crossdomain.xml i used the crossdomain.xml as follows: public function initApp():void { Security.allowDomain( "remoteservername" ); Security.loadPolicyFile( "http://remoteservername:8080/main/crossdomain.xml" ); var request:URLRequest = new URLRequest( "http://remoteservername:8080/main/crossdomain.xml" ); var loader:URLLoader = new URLLoader(); loader.load( request );}
Sris