dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Cross browser image loading problem

Hybrid View

  1. #1
    Brian Monnone
    Join Date
    Jul 2000
    Posts
    316

    Cross browser image loading problem

    I am trying to load a facebook profile image into flash.

    I have the function fbSetUserPic called with the path to the image that we receive from facebook for the user profile. Here is what the function looks like:

    Code:
    function fbSetUserPic(fbPic){
    	loadMovie(fbPic, fbMain.fbMainPostLogin.fbProfileImage);
    }
    Initially, the fbMain.fbMainPostLogin.fbProfileImage movie clip shows a gray box.

    This function works when I try it in firefox and it replaces the gray box with the profile image. The problem is that it does not seem to work in any other browsers (IE, Safari, Chrome). Instead of loading the facebook profile image, the gray box disappears but no image appears in its place.

    One thing that I tried when I was debugging is hardcoding an image on the local server into the function rather than loading the path received from facebook. The image loaded in all browsers using this method. It worked for both an image in the same directory as the flash, and an image in a different directory on the same server.

    I have tried a crossdomain.xml file allowing every domain, but that doesn't seem to work. I don't think that is the issue because it works in firefox whether I have crossdomain.xml file there or not.

    I've tried all kinds of googling and haven't come up with a solution. Does anybody have any ideas?

    Thanks,
    Brian
    Last edited by Sigma; 07-30-2009 at 12:44 PM.

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    In order to load images from an external domain, a cross domain policy file is needed on the domain you're loading the image from.
    This means that facebook should have a crossdomain.xlm file, giving permissions to your domain... whihc I'm sure it's not happening...

    You can use a server side scripting language like PHP, on your server, to load the image, and act as a proxy.

  3. #3
    Brian Monnone
    Join Date
    Jul 2000
    Posts
    316
    Thanks for the reply. I tried the crossdomain policy as a last ditch effort...I'm using server side scripts to communicate with the FB API via JS. he odd thing is Firefox works just fine...all other browsers do not. Also, I'm using ExternalInterface that pops a JS function to make the call.

    Anything else I should consider?

    Brian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center