Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i simply count friends name. #12

Closed
GoogleCodeExporter opened this issue Jun 20, 2015 · 5 comments
Closed

how can i simply count friends name. #12

GoogleCodeExporter opened this issue Jun 20, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

following is my code, but it's not working


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:fc="http://www.adobe.com/2006/fc" layout="absolute"
creationComplete="init();">

    <mx:Script>
        <![CDATA[

            import com.pbking.facebook.data.users.FacebookUser;
            import com.pbking.facebook.delegates.users.GetUserInfoDelegate;
            import com.pbking.facebook.delegates.friends.GetFriendsDelegate;
            import com.pbking.facebook.data.users.UserFields;
            import com.pbking.facebook.FacebookSessionType;
            import com.pbking.facebook.Facebook;
            import mx.controls.Alert;




            [Bindable] public var fBook:Facebook;
            [Bindable] public var friendNum:int;
            [Bindable] public var showmyuid:String;



            private function init():void
            {
                //create our facebook instance
                fBook = new Facebook();
                fBook.addEventListener(Event.COMPLETE, onFacebookReady);

                //start up a widget instance
                var fv:Object = Application.application.parameters;
                fBook.startWidgetSession(fv, "key1", "key2");

            }

            private function onFacebookReady(event:Event):void
            {
                if(fBook.isConnected)
                {

                    var myuid:int = fBook.user.uid;

                    showmyuid = myuid.toString();

                    var cuser:FacebookUser = new FacebookUser(myuid);

                    friendNum = cuser.friends.length;
                }
                else
                {
                    Alert.show("(widget) Facebook Connection Failed!");
                }
            }


        ]]>
    </mx:Script>

    <mx:Label x="20" y="20" text="{friendNum.toString()}"/><!--not working-->
    <mx:Label x="20" y="40" text="{showmyuid}"/><!--working-->


</mx:Application>

Original issue reported on code.google.com by goodhes...@gmail.com on 3 Feb 2009 at 5:21

@GoogleCodeExporter
Copy link
Author

sorry, count friends number.

Original comment by goodhes...@gmail.com on 3 Feb 2009 at 5:22

@GoogleCodeExporter
Copy link
Author

Original comment by daniel.d...@gmail.com on 30 Mar 2009 at 5:12

  • Added labels: Milestone-Release2.0

@GoogleCodeExporter
Copy link
Author

If i understand you right, you could just call GetFriends command. After 
completing 
this, you can acces the ammount of your friends by 

facebook_event.data.friends.length

for example:

var call:FacebookCall = fbook.post(new GetFriends());
call.addEventListener(FacebookEvent.COMPLETE, onGetFriends);

function onGetFriends(e:FacebookEvent)
{
    var l:int = (e.data as GetFriendsData).friends.length;
trace(l)
}

Original comment by vojta.ha...@gmail.com on 30 Oct 2009 at 10:47

@GoogleCodeExporter
Copy link
Author

all of my "facebookevent.complete" returns a "1046: Type was not found or was 
not a
compile-time constant: FacebookEvent."

does anybody knows why? =/
tks

Original comment by el.iag...@gmail.com on 19 Nov 2009 at 10:34

@GoogleCodeExporter
Copy link
Author

New release based of Facebook's Graph API is coming soon.  SDK which this issue 
depends on is no longer supported by Facebook.

Original comment by alan...@gmail.com on 29 Sep 2010 at 7:49

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant