Apr 28, 2011

Loading pictures from Facebook

I ran into flash security problem when as3 application tried to load users profile picture. It seems started after Flash Player 10.2 update today.

If you get error like this:

SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content: http://mydomain.com/my.swf cannot access https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/1234_1424341323_7322_s.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.

You need to load policy file from facebook by

Security.loadPolicyFile("https://fbcdn-profile-a.akamaihd.net/crossdomain.xml");

Before today it was enough to load it from here
Security.loadPolicyFile("http://profile.ak.fbcdn.net/crossdomain.xml");

Waiting for news from Facebook or Adobe about these changes.