我想知道是否有人知道创建 AS3 Facebook 分享按钮的好方法?我需要能够自定义标题、描述和图片。谢谢!
最佳答案
看:http://www.facebook.com/facebook-widgets/share.php
http://www.facebook.com/sharer.php?u=<url>&t=<title>
在闪存中:
import flash.net.navigateToURL;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
share_btn.addEventListener(MouseEvent.CLICK, shareClickHandler);
function shareClickHandler(evt:MouseEvent):void
{
var varsShare:URLVariables = new URLVariables();
varsShare.u = 'http://domain.com/pageN.html';
varsShare.t = 'Title Page';
var urlFacebookShare:URLRequest = new URLRequest('http://www.facebook.com/sharer.php');
urlFacebookShare.data = varsShare;
urlFacebookShare.method = URLRequestMethod.GET;
navigateToURL(urlFacebookShare, '_blank');
}
为了使用图片添加以下元标签:
<meta name="title" content="my title" />
<meta name="description" content="my description" />
<link rel="image_src" href="images/thumbnail_image.jpg" />
关于flash - 如何在 AS3 中创建分享按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2511918/