2012年5月23日 星期三

how to tag people(friends) in a facebook photo using flash(as3)

facebook 上傳照片時如何 tag 朋友?

可以用 tags 這個這個屬性,
tags:JSON.encode([ { "tag_uid":_friendId, "x":0, "y":0 } ])

說明如下,
tag_uid: friend id
tag_text: some text
x: 水平x座標,百分比[0-100]
y: 垂直y座標,百分比[0-100]

*注意* 最後記得要 JSON.encode 成字串

完整範例如下

Facebook.api("me/photos", function(result:Object, fail:Object):void
{
if (result) {
trace("success");
// blah blah blah...
}
},
{
image:bmp, message:"your message", fileName:'card.jpg', tags:JSON.encode([ { "tag_uid":_friendId, "x":0, "y":0 } ])
}
);
view raw gistfile1.as hosted with ❤ by GitHub

沒有留言:

張貼留言