Authorizing a Facebook account

The user session information is passed to Flash via flashvars parameters.

if (loaderInfo.parameters.fb_sig_added == undefined) {
// do nothing when the flash is compiled from Flash IDE
}
else if(loaderInfo.parameters.fb_sig_added == true){
var session:FacebookSessionUtil=new FacebookSessionUtil(loaderInfo.parameters.fb_sig_api_key,null,loaderInfo);
_fb=session.Facebook;
session.addEventListener(FacebookEvent.CONNECT,onConnect);
session.verifySession();
}else{
navigateToURL(new URLRequest("http://www.Facebook.com/login.php?api_key="+loaderInfo.parameters.fb_sig_api_key),"_top");
}

In our first example, we try to simply put the Flash virtual world inside the Facebook platform. Therefore, we leave the onConnect function ...

Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.