如何创建在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...

我想知道是否有人知道创建一个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!

推荐答案

查看: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" />

有关详细信息:https://developers.facebook.com/docs/opengraph/

阅读全文

相关推荐

最新文章