Question

I want to place my crossdomain.xml file in a different location than the root because it just creates to much dependency issues.

How can i tell flex to look from my crossdomain.xml file somewhere other than the root?Do i add the loadPolicy code to the init method of my flex app?

Does anyone have any good samples on this?

Was it helpful?

Solution

From the docs:

loadPolicyFile() method

Looks for a policy file at the location specified by the url parameter.

OTHER TIPS

There is another option. If a cross domain policy file isn't specified, then Flex will send "" to the socket server. The server can then write the contents of the cross domain policy file to the socket. Flex will close the connection, and re-connect if everything checks out OK.

The downside to this approach is that it will take about 1-2 seconds from originally making the connection on the Flex side to getting a full, working connection (the flash.events.Event.CONNECT event is sent once the connection is fully established, though). If that isn't acceptable, placing the cross domain policy file in the root is likely your best option.

Security.allowDomain("*"); Security.loadPolicyFile("https://play2beatme.com/crossdomain.xml"); use this code inside your init() method...i hope this will help u

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top