ActiveDen

Facebook graph api problem

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

Hey guys,

been struggling with a thing here for some days now hope you can help me out on this.

I’m developing a application in as3 that fetches a user profile image by an id from facebook and it works just perfect when I test movie within flash locally. But when I test it with xampp or in my server in any browser it simply doesn’t work…

It gets stuck in the line: Facebook.api(comments.*[commentLoading].@id, completed);

Anyone got this problem before or worked with facebook api? I really could use some help :/

Thanks

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

no guesses?? :s

133 posts
  • Microlancer Beta Tester
  • Sold between 50 000 and 100 000 dollars
  • Interviewed on the Envato Notes blog
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Has been a member for 3-4 years
  • Beta Tester
+2 more
goTo says

Well, I haven’t work with that but sometimes when Flash is connecting to external server you will need a “crossdomain.xml” or you need to allow script access by using “allowScriptAccess”.

7 posts
  • Bought between 50 and 99 items
  • Has been a member for 5-6 years
baptiste says

Yes GoTo have a part of the response, you must load the facebook policy file before downloading images from FB, like this :

Security.loadPolicyFile("http://graph.facebook.com/crossdomain.xml"); var loader:Loader = new Loader(); var context:LoaderContext = new LoaderContext(true); loader.load(yourUrlRequest, context);

This works for me.

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

Thanks goTo and baptiste, I’ll give it a shot and tell how it went :)

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

Do I have to call init first? It’s not working :s

                        Facebook.init("180551898647295", handleLogin);

            function handleLogin(session:Object, fail:Object):void {
                if (session != null) {
                    trace("Successfully Logged In");
                    logged=true;
                    UserSession=session as FacebookSession;
                    nextFun();
                }
                else{
                    trace("JJJ");
                    Facebook.login(handleLogin, []);
                }
            }

This is not working at all, it should pop up a window for the login but it doesn’t. I’m getting confused right now. Locally it traces nothing. On server nextFun is called so as Facebook.login(handleLogin, []);

Anyone worked with this api before that could send me some good examples?

thanks

7 posts
  • Bought between 50 and 99 items
  • Has been a member for 5-6 years
baptiste says

Well, it seems to be another problem. I think you must have a facebook application with access token to request the graph API , but just installing the flash player debugger for your browser will probably give you more information about this issue.

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

It doesn’t throw any error, that’s the strangest thing :p

7 posts
  • Bought between 50 and 99 items
  • Has been a member for 5-6 years
baptiste says

Check that cookies are enabled,i know it won’t work otherwise, but this is my last idea

509 posts
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Portugal
plusquare says

Check that cookies are enabled,i know it won’t work otherwise, but this is my last idea

Nothing :/ thanks anyway.

by
by
by
by
by