Using the Actionscript API, I am receiving the following IOError
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://graph.facebook.com/********/feed"]
I am using the following code :
package
{
import flash.display.Sprite;
import com.facebook.graph.Facebook;
import flash.system.Security;
public class Test extends Sprite
{
public function Test()
{
Security.allowDomain("*.facebook.com");
Security.allowDomain("profile.ak.fbcdn.net");
Security.allowDomain("static.ak.fbcdn.net");
Security.allowDomain("graph.facebook.com");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://graph.facebook.com/crossdomain.xml");
Facebook.init("************", initHandler);
var permissions:Array = ['publish_stream'];
Facebook.login( loginHandler, { perms:permissions.join(',') } );
}
private function loginHandler(success:Object,fail:Object):void
{
trace("loginHandler success ="+success);
trace("loginHandler fail ="+fail);
if(success)
{
Facebook.api('/me/', handleMeLoad);
}
else
{
trace("unable to connect to Facebook");
}
}
private function handleMeLoad(response:Object, fail:Object):void
{
if (response)
{
trace("response.first_name = "+response.first_name);
trace("response.last_name = "开发者_如何学编程+response.last_name);
trace("response.id "+response.id);
var values:Object = {
message:"MESSAGE"
};
Facebook.api('/'+response.id+'/feed', handlePostComplete, values, "POST");
}
}
private function initHandler(success:Object,fail:Object):void
{
trace("initHandler response = "+success);
trace("initHandler fail = "+fail);
}
private function handlePostComplete(response:Object, fail:Object)
{
trace("handlePostToFriendsWallComplete response "+response);
trace("handlePostToFriendsWallComplete fail "+fail);
}
}
}
(with all the fb vars as Strings)
using Flash player 10.
The line facebook.init is incorrectly stated. Whilst the documentation for the Actionscript implentation of the FB API is horrendous, you can get some pointers from the J(s)DK.
http://developers.facebook.com/docs/reference/oldjavascript/FB.Facebook.init/
Turns out Facebook blacklisted my IP / Account. They could have at least told me... very unhelpfull
精彩评论