I track (and log on the server) most of the user errors in our flash game. Quite often, I see security errors associated with trying to make requests for a cross-domain URL (usually the Facebook API). 99% of our players can make these Graph API calls without a problem.
What I think is that the client makes a request but does not load the crossdomain.xml file. I don’t quite understand how AS3 handles this in case of refusal to download the crossdomain policy file ... will it try again for each URLRequest until it succeeds in downloading it, or will it just stay forever? What is the “best practice” in response to such a security error?
I preload the Facebook policy files once, ahead of time, for example:
// allow images to be loaded from facebook and facebook cdn's. Security.loadPolicyFile( "http://www.facebook.com/crossdomain.xml" ); Security.loadPolicyFile( "https://api.facebook.com/crossdomain.xml" ); Security.loadPolicyFile( "https://graph.facebook.com/crossdomain.xml" ); Security.loadPolicyFile( "http://profile.ak.fbcdn.net/crossdomain.xml" );
then I also checked the policy file again when creating the URLRequest .
security flash actionscript-3 facebook facebook-graph-api
Toxikman
source share