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.

8 comments:

  1. It's related to every image you are trying to download from FB.

    http://www.webii.pl/blog/?p=11

    M.

    ReplyDelete
  2. Thanks for posting this... helped me look in right direction. they may have made more changes ... to make mine work I had to do

    Security.loadPolicyFile("http://profile.ak.fbcdn.net/crossdomain.xml");

    ReplyDelete
  3. thanks. I finally found the need to load this file "https://fbcdn-profile-a.akamaihd.net/crossdomain.xml" from your site. You made my day!

    ReplyDelete
  4. thanks for solution. i hate facebook :)

    ReplyDelete
  5. thanks man awesome!

    ReplyDelete
  6. Thank you so much for this help. Your karma hitpoints have grown two sized this day!

    ReplyDelete
  7. Security.loadPolicyFile("http://graph.facebook.com/crossdomain.xml");
    Security.loadPolicyFile("http://profile.ak.fbcdn.net/crossdomain.xml");
    Security.loadPolicyFile('http://fbcdn-profile-a.akamaihd.net/crossdomain.xml');
    Security.loadPolicyFile('http://fbcdn-sphotos-a.akamaihd.net/crossdomain.xml');
    Security.loadPolicyFile('http://fbcdn-photos-a.akamaihd.net/crossdomain.xml');

    ReplyDelete
  8. The following file no longer exists:

    http://fbcdn-sphotos-a.akamaihd.net/crossdomain.xml

    ReplyDelete