This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Find all posts by this user
Quote this message in a reply
Post Reply 


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

Forum Jump:


User(s) browsing this thread: 1 Guest(s)