我正在构建一个Flash网站,我希望能够允许用户将动态生成的信息发布到他们的Facebook墙上,但我无法在Facebook开发人员文档中找到任何信息。
在Javascript / HTML中足够简单:
<script type="text/javascript">
function callPublish(msg, attachment, action_link) {
FB.ensureInit(function () {
FB.Connect.streamPublish('', attachment, action_link);
});
}
</script>
<input type="button" onclick="callPublish('',{'name':'Post this to Facebook','href':'http://dev2.com','description':'this is some body test'},null);return false;" value="Preview Dialog" />
正如您所看到的,我不想创建会话或登录或任何复杂的内容,只需将信息发布到他们的墙上即可。
答案 0 :(得分:1)
你可以从flash调用javascript函数。就像一个带有getUrl "callPublish('',{'name':'Post this to Facebook','href':'http://dev2.com','description':'this is some body test'},null);return false;"
的按钮。
答案 1 :(得分:1)
您还可以使用ExternalInterface从Flash调用javascript函数。
请参阅http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html