0

我一直在寻找这个解决方案一段时间没有找到任何好的解决方案。我所看到的一切要么是 2 岁,要么不起作用。

我想做的是在我的 Flash 文件中使用 MC 来充当按钮,然后单击打开 sharethis 弹出窗口以共享此特定视频的 url。站点 API 文档确实没有涉及 Flash 与 sharethis 一起使用。任何帮助都可以。

谢谢,

马特

4

1 回答 1

2

分享 这适用于 HTML、框架并使用 javascript。您需要一个外部接口才能使用它。当你说住在瑞士法郎时,我不确定我们是否在同一页面上。您可能必须将其绑定到某个对象或某种对象才能实现它。

您是否查看Barklund.org以了解他们在 ShareThis 和ExternalInterface上的工作?

他们将程序分解如下

首先,只需转到 sharethis.com 发布者部分并自定义您的小部件。不要将小部件代码片段放在您想要按钮的位置,而是将其放在您网站的头部。

<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=636e055b-a4a2-4f9c-872c-b7aa9a701bb0&amp;type=website&amp;send_services=email&amp;post_services=facebook%2Clinkedin%2Cmyspace%2Cdigg%2Cdelicious%2Ctwitter%2Creddit%2Ctechnorati%2Cwordpress%2Cblogger%2Cgoogle_bmarks%2Cwindows_live"></script>

然后创建一个小的 javascript 函数,如:

  function share(url, title) {
    var s = SHARETHIS.addEntry({
      url: url,
      title: title
    }, {button:false,popup:true});
    s.popup()
    return false;
  }

最后,使用ExternalInterface从 Flash 中简单地调用此函数 :

var url:String = "http://www.barklund.org/blog/2009/05/06/using-sharethis-with-flash/";
var title:String = "Barklund.org - Using ShareThis with Flash";
import flash.external.ExternalInterface;
ExternalInterface.call("share", url, title);

作者也有一些评论说由于 API 的更改而出现问题,但该示例对我来说效果很好。如果没有,您可以查看 Using AddThis with Flash implementation

于 2010-06-07T21:12:07.137 回答