通过闪存/ ActionScript中的Facebook墙上张贴消息闪存、墙上、消息、Facebook

2023-09-08 15:28:17 作者:哥的裤裆里有wifi

我创建一个游戏,需要与Facebook的整合。本场比赛进行,一旦complets该游戏的用户也补充说,发送的比分Facebook的墙用户的按钮。

我已经下载了Facebook的API闪存,并能够连接到用户,并获得其ID。但我不知道是什么命令来使用张贴在墙上的用户将比分或消息通过SWF。

下面是基本的codeS ...

 进口com.facebook.data.users.GetInfoData;
进口com.facebook.utils.FacebookSessionUtil;
进口com.facebook.data.users.FacebookUser;
进口com.facebook.data.users.GetInfoFieldValues​​;
进口com.facebook.data.friends.GetFriendsData;
进口com.facebook.commands.users.GetInfo;
进口com.facebook.commands.friends *。
进口com.facebook.net.FacebookCall;
进口com.facebook.events.FacebookEvent;
进口com.facebook.Facebook;

VAR fbook:Facebook的; //创建变量Facebook的实例
VAR会议:FacebookSessionUtil; //创建闪存会话工具

会议=新FacebookSessionUtil(myAPPIT,KEY,的LoaderInfo); //初始化会话
session.addEventListener(FacebookEvent.CONNECT,onFacebookConnect,假,0,TRUE); //如果脸书连检查

fbook = session.facebook; // fbook持有Facebook的实例作为财产
fbook.login(真正的); //连接到Facebook的


login_btn.addEventListener(MouseEvent.CLICK,connectToFB);
功能connectToFB(五:事件):无效
{
    session.validateLogin();
}

功能onFacebookConnect(E:FacebookEvent):无效
{
    跟踪(是Facebook的连接:+ fbook.is_connected);

    VAR电话:FacebookCall = fbook.post(新的GetInfo([fbook.uid],[GetInfoFieldValues​​.ALL_VALUES]));

    call.addEventListener(FacebookEvent.COMPLETE,onGetInfo);
}

功能onGetInfo(E:FacebookEvent):无效
{
    变种用户=(e.data作为GetInfoData).userCollection.getItemAt(0)作为FacebookUser;
    跟踪(你好,+ user.first_name ++ user.last_name);
}
 

解决方案

您需要这个功能

UpassLock下载 UpassLock U盘开机锁 下载v3.2 免安装版

http://developers.facebook.com/docs/reference/rest/ stream.publish

简单的例子可以在这里找到:

的http://nova$c$crs.blogspot.com/2010/02/publish-post-to-facebook-wall-news.html

I am creating a game that needs to be integrated with Facebook. The game is done and once the user complets that game it adds the button that send score to the Facebook wall of the user.

I have downloaded the Facebook api for flash and is able to connect to the user and get its id. But I don't know what command to use to post the score or message on users wall via swf.

Below is the basic codes...

import com.facebook.data.users.GetInfoData;
import com.facebook.utils.FacebookSessionUtil;
import com.facebook.data.users.FacebookUser;
import com.facebook.data.users.GetInfoFieldValues;
import com.facebook.data.friends.GetFriendsData;
import com.facebook.commands.users.GetInfo;
import com.facebook.commands.friends.*;
import com.facebook.net.FacebookCall;
import com.facebook.events.FacebookEvent;
import com.facebook.Facebook;

var fbook:Facebook; // Creating variable for facebook instance
var session:FacebookSessionUtil; //a utility for flash session is created

session = new FacebookSessionUtil("myAPPIT", "KEY", loaderInfo);// initializing the session
session.addEventListener(FacebookEvent.CONNECT, onFacebookConnect, false, 0, true);// checking if the face book is connected

fbook = session.facebook; // fbook holds the facebook instance as a property
fbook.login(true); // connected to the facebook 


login_btn.addEventListener(MouseEvent.CLICK, connectToFB);
function connectToFB(e:Event):void
{
    session.validateLogin();    
}

function onFacebookConnect(e:FacebookEvent):void
{ 
    trace("Is Facebook connected: " + fbook.is_connected);  

    var call:FacebookCall = fbook.post(new GetInfo([fbook.uid],[GetInfoFieldValues.ALL_VALUES]));

    call.addEventListener(FacebookEvent.COMPLETE,onGetInfo);
}

function onGetInfo(e:FacebookEvent):void
{ 
    var user = (e.data as GetInfoData).userCollection.getItemAt(0) as FacebookUser;
    trace("Hello, " + user.first_name + " " + user.last_name);
} 

解决方案

you need this function

http://developers.facebook.com/docs/reference/rest/stream.publish

quick example could be find here:

http://novacoders.blogspot.com/2010/02/publish-post-to-facebook-wall-news.html