如何创建在AS3一个分享按钮 [英] How to create a share button in AS3
本文介绍了如何创建在AS3一个分享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否有人知道创建一个AS3 Facebook分享按钮的好方法?我需要能够定制标题,描述和图片。谢谢!
I was wondering if anyone knew a good way of creating an AS3 Facebook share button? I need to be able to customize the title, description and picture. Thanks!
推荐答案
查看:<一href="http://www.facebook.com/facebook-widgets/share.php">http://www.facebook.com/facebook-widgets/share.php
http://www.facebook.com/sharer.php?u=<url>&t=<title>
在Flash:
In Flash:
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');
}
为了使用图片添加下列元标记:
In order to use a picture add the following Metatags:
<meta name="title" content="my title" />
<meta name="description" content="my description" />
<link rel="image_src" href="images/thumbnail_image.jpg" />
有关详细信息:<一href="https://developers.facebook.com/docs/opengraph/">https://developers.facebook.com/docs/opengraph/
这篇关于如何创建在AS3一个分享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文