Closed GoogleCodeExporter closed 9 years ago
Update: Installed Flash Player 10.3 again to test it - same thing all across
the board.
I figured I might as well show you the code so you can see what I'm doing. This
is taken directly from a sample done previously as a tutorial to get this
working. It has worked consistently prior to updating the library earlier today.
protected static const APP_ID:String = "_IDHERE_";
protected static var opts:Object = {perms:"publish_stream,user_photos,user_activities,read_mailbox"};
public function FlashWebMain() {
configUI();
}
protected function configUI():void {
//hide the params input by default
paramsLabel.visible = paramsInput.visible = false;
//listeners for UI
loginToggleBtn.addEventListener(MouseEvent.CLICK, handleLoginClick, false, 0, true);
callApiBtn.addEventListener(MouseEvent.CLICK, handleCallApiClick, false, 0, true);
getRadio.addEventListener(MouseEvent.CLICK, handleReqTypeChange, false, 0, true);
postRadio.addEventListener(MouseEvent.CLICK, handleReqTypeChange, false, 0, true);
clearBtn.addEventListener(MouseEvent.CLICK, handleClearClick, false, 0, true);
//Initialize Facebook library
Facebook.init(APP_ID, onInit, opts);
}
protected function onInit(result:Object, fail:Object):void {
trace("onInit:");
if (result != null) { //already logged in because of existing session
trace("Logged in!");
outputTxt.text = "onInit, Logged In As "+result.uid+"\n";
loginToggleBtn.label = "Log Out";
} else {
trace("Not logged in: "+fail);
outputTxt.text = "onInit, Not Logged In\n";
}
}
protected function handleLoginClick(event:MouseEvent):void {
if (loginToggleBtn.label == "Log In") {
trace("Trying Facebook Login!");
Facebook.login(onLogin, opts);
} else {
Facebook.logout(onLogout);
}
}
protected function onLogin(result:Object, fail:Object):void {
if (result) { //successfully logged in
outputTxt.text = "Logged In As "+result.uid+"\n";
loginToggleBtn.label = "Log Out";
} else {
outputTxt.appendText("Login Failed\n");
}
}
Original comment by ort...@gmail.com
on 25 Oct 2011 at 10:39
After hours of frantic comparisons back and forth between the examples, I
determined my problem was the line
protected static var opts:Object =
{perms:"publish_stream,user_photos,user_activities,read_mailbox"};
At some point the perms object was changed to scope. In my massive panic I
never noticed the miniscule change:
private static const opts:Object = {scope:"user_photos,user_birthday,email"};
No bug to report.
Original comment by ort...@gmail.com
on 25 Oct 2011 at 11:42
Original comment by edwar...@gmail.com
on 26 Oct 2011 at 3:41
Original issue reported on code.google.com by
ort...@gmail.com
on 25 Oct 2011 at 10:18