Facebook and ActionScript
I'm using Flash P开发者_JAVA百科rofessional, and my game is coded on that basically. I'm trying to import the web graph-API and tested it on my website, and I still can't get it to work to the point I can't even get a connection.
I run this code at the beginning of a code:
Facebook.init("API CODE", handleLogin);
Then my login:
function login(session:Object, fail:Object):void
{
if(session != null) {
player_name = session.user.name;
}
else {
player_name = "failed";
}
}
and nothing happens. Better yet, I use trace and the handleLogin
is never called, but when I make a Flex document it works. How do I fix this problem?
Are you trying to use a web-based lib in an ActionScript 3 project, or are you using the ActionScript 3 Facebook API:
Have you tried one of the examples to get it working?
精彩评论