getting CS5 to run facebook API?
|
06-17-2014, 01:12 AM
Post: #2
|
|||
|
|||
Hi, the Actionscript SDK quickstart examples on the Adobe website may be of help to you:
http://www.adobe.com/devnet/facebook.html ** Note you cannot run/test Facebook API code on your local machine specially through AS3. You must first place it on a server to test if it works. Here some i.e code.. // import the class import com.facebook.graph.Facebook; // you must first initiate your Facebook class Facebook.init('Application_ID',FBConnected,{perms:"read_stream,publish_stream"}); // if you are logged into Facebook and the user has not already allowed the application access, it asks the user if the application can read streams and publish to them var fbSession:Object = new Object(); var myAvatarURL:String = ""; function FBConnected(success:Object,fail:Object) { if(success) { fbSession = Facebook.getSession(); // gets the current session // use fbSession.accessToken as your session token Facebook.api("/me",getMeHandler); // asks for your profile information } } function getMeHandler(result:Object,fail:Object) { if(result) { trace(result.name); // returns your profile name as string trace(result.id); // returns your id as string // check out https://graph.facebook.com/me?access_token... for more information on what result returns myAvatarURL = Facebook.getImageUrl(result.id); // use this to create a URLRequest to get your avatar } } After doing that try to visit this link for more flash games... http://bit.ly/eKsNpR Ads |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
getting CS5 to run facebook API? - Bluwind - 06-17-2014, 01:04 AM
[] - Kevin Nazki - 06-17-2014 01:12 AM
|
User(s) browsing this thread: 1 Guest(s)