Skip navigation
Currently Being Moderated

Image post in Facebook wall

Jul 27, 2012 12:41 AM

Hi,

       I would like to know, how can i post the image in facebook and google+ via my flash interface developed in AS2. Any ideas will be pretty much helpful for my developement as i don't have any idea of doing it.

 

I have created the site and user can upload the files from his desktop. my pendig part is, if user wants to post a image from his uploaded photo, he needs to have a option for that.

 

Kindly help me out.

 

Regards,

Kameshwaran A.

 
Replies
  • kglad
    62,206 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 27, 2012 7:14 AM   in reply to A.kameshwaran

    after logging in the user, you can use (with the externalinterface class in flash to call feedF and receive the return from fb by defining swfF) the following javascript:

     

    function feedF(){
        var obj = {
          method: 'feed',
          link: 'http://www.kglad.com/Files/fb',
          picture: 'http://www.kglad.com/Files/fb/game_01.jpg',
          name: 'game_01 feed test',
          caption: 'game_01',
          description: 'game_01 feed dialog.'
        };

     

        FB.ui(obj, function(response){
            toSWF("feed response **");
            evalF(response);
        });
    }
    function evalF(obj){
        if(typeof obj == "object"){
            for(var s in obj){
                toSWF(s);
                evalF(obj[s]);
            }
        }  else {
            toSWF(obj);
        }
    }

     

     

         function thisMovie(movieName) {

             if (navigator.appName.indexOf("Microsoft") != -1) {

                 return window[movieName];

             } else {

                 return document[movieName];

             }

         }

         function toSWF(value) {

             thisMovie("game_01").swfF(value);  // use your swf's name

         }

     
    |
    Mark as:
  • kglad
    62,206 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 27, 2012 11:16 PM   in reply to A.kameshwaran

    just pass whatever arguments you want to use:

     

    function feedF(linkS,imageS);

     

    ar obj = {

    method: 'feed',

    link: linkS,

    picture: imageS,

    name: 'game_01 feed test',

    caption: 'game_01',

    description: 'game_01 feed dialog.'

    };


    }

     
    |
    Mark as:
  • kglad
    62,206 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2012 12:20 AM   in reply to A.kameshwaran

    you're sending a variable to feedF but feedF does not accept a parameter.  fix that.

     
    |
    Mark as:
  • kglad
    62,206 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2012 7:32 AM   in reply to A.kameshwaran

    did you login the user and get permission to post to their wall?

     
    |
    Mark as:
  • kglad
    62,206 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 3, 2012 7:06 AM   in reply to A.kameshwaran

    you should use something like the following to login the user:

     

      (function(d, s, id) {

            var js, fjs = d.getElementsByTagName(s)[0];

            if (d.getElementById(id)) return;

            js = d.createElement(s); js.id = id;

            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=229095550543776";

            fjs.parentNode.insertBefore(js, fjs);

        }(document, 'script', 'facebook-jssdk'));

     

        // initialize with fb js (after it loads) with your App ID

        window.fbAsyncInit = function() {

          FB.init({

            appId      : 'YOUR APP ID',

            status     : true, // check login status

            cookie     : true, // enable cookies to allow the server to access the session

            xfbml      : true  // parse XFBML

          });

          // fbLoginStatus is called when there is a login status change and when fb js initializes

          function fbLoginStatus(response) {

              // If the user is logged in, response.status is 'connected'

              if (response.status === 'connected') {

                FB.api('/me', function(response) {

                    toSWF("is connected:: "+response.status);

                    evalF(response);

                });

              } else {

                  // The user is not logged-in.

                  toSWF("not connected:: "+response.status);

                  evalF(response);

              }

          }

          // This is the code that calls fbLoginStatus on initialization

          FB.getLoginStatus(fbLoginStatus);

          // This is the code that call fbLoginStatus when there is a status change

          FB.Event.subscribe('auth.statusChange', fbLoginStatus);

        };

     

    // and you can use the following to request permissions.  the permissions are hard-coded below but you may want to pass a parameter to permissionsF if you want flexibility here:

     

    function permissionsF(){
        var obj = {
            method: 'permissions.request',
            perms: 'user_birthday,user_relationship_details,read_stream',
            display: 'popup'
        };
        FB.ui(obj, function(response) {
             toSWF("permissions **");
             evalF(response);
        });
    }

     

    p.s.  please mark helpful/correct responses.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points