从flash应用程序访问Facebook相册
我想创建一个flashfacebook应用程序,在这个应用程序中,按下一个按钮后,用户将能够浏览他/她的相册并选择一张照片。我该怎么做?要从使用此应用程序的任何用户处获得身份验证,按钮下的代码是什么?从flash应用程序访问Facebook相册,facebook,flash-cs5,Facebook,Flash Cs5,我想创建一个flashfacebook应用程序,在这个应用程序中,按下一个按钮后,用户将能够浏览他/她的相册并选择一张照片。我该怎么做?要从使用此应用程序的任何用户处获得身份验证,按钮下的代码是什么? 谢谢。我目前正在为一项大学作业编写一个facebook应用程序,该应用程序将允许用户通过flash player窗口在facebook上做你能做的一切。要做到这一点,你需要做一些基本的事情 用户登录和身份验证-必须通过Facebook完成-使用OAuth身份验证,并符合Facebook的所有安全策
谢谢。我目前正在为一项大学作业编写一个facebook应用程序,该应用程序将允许用户通过flash player窗口在facebook上做你能做的一切。要做到这一点,你需要做一些基本的事情
//initialise variables
public var photoURL:String;
var Request:URLRequest = new URLRequest("http://www.whatever the url for the graph api service you are using which is founf from FB");
//that ^^ will send off a request for the url, you then want to use the returned data by registering an event handler like this below
functionName.addEventListener(onComplete, completeHandler);
functionName(event, EVENT)
{
var loader:URLLoader = new URLLoader(Request);
var data:XML = new XMLData(load.loader); //i think this is right but not 100% sure, fiddle with it
//then you want to extract the data that is returned, for example, extracting xml data from a rest request works by hitting data from the xml by specifying a path to the object you want. an example of xml is this <rsp stat="ok"><photos ......more code="morecode"><photo url="url of photo"></photo</photos> so you can hit the url in that example like this;
photoURL = data.photos.photo.@url; //this line will grab the photo url for you, allowing you to dynamically create an array and assign photos to the flash stage according to the url you get
}
//初始化变量
public-var-photoURL:String;
变量请求:URLRequest=新的URLRequest(“http://www.whatever 您正在使用的图形api服务的url,它是来自FB的founf”);
//^^将发送对url的请求,然后您希望通过注册如下事件处理程序来使用返回的数据
functionName.addEventListener(onComplete,completeHandler);
函数名(事件,事件)
{
变量加载器:URLLoader=新的URLLoader(请求);
var-data:XML=new-XMLData(load.loader);//我认为这是正确的,但不是100%确定的,请修改它
//然后您需要提取返回的数据,例如,从rest请求提取xml数据的工作方式是通过指定所需对象的路径从xml中点击数据?