如何将 sharethis 按钮添加到我的 Flash 文件中?

发布于 2024-09-04 19:11:49 字数 206 浏览 4 评论 0原文

我一直在寻找这个解决方案一段时间,但没有找到任何好的可靠解决方案。我所看到的所有东西要么已经有 2 年历史了,要么不起作用。

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

谢谢,

马特

I have been searching for this solution for some time have not found any good solid solutions. Everything I have seen is either 2 years old and does not work.

What I would like to do is use a MC in my flash file to act like a button and when clicked open the sharethis pop up to share this particular video's url. The site API docs really don't touch on Flash working with sharethis.
Any help would do.

Thanks,

Matt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一江春梦 2024-09-11 19:11:49

分享 这适用于 HTML、框架并使用 JavaScript。
您需要一个外部接口才能使用它。当你说 live in swf 时,我不确定我们是否意见一致。您可能必须将其绑定到某个对象或某种类型才能实现它。

您是否检查过 Barklund.org他们在 ShareThis 和 ExternalInterface 上的工作?

他们将程序分解如下

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

<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=636e055b-a4a2-4f9c-872c-b7aa9a701bb0&type=website&send_services=email&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;
  }

最后简单调用一下这个函数
从 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 的更改而出现问题,但 示例 对我来说效果很好。如果没有,您可以查看使用 AddThis使用 Flash 实现

Share This works in HTML,frames and uses javascript.
You would need an external interface to use it. I am not sure we are on the same page when you say live in the swf. You may have to bind it to some object or the sorts to achieve it.

Did you check Barklund.org for their working on ShareThis and ExternalInterface ?

They have broken down the procedure as follows

First, simply go to sharethis.com
publisher section and customize your
widget. Instead of placing the widget
code snippet where you want the
button, put it in the head section
of your website.

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

Then create a little javascript
function like:

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

Finally, simple call this function
from Flash using
ExternalInterface:

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);

There are also some comments from the author saying there were problems due to the change in the API but the example worked well for me. If it does not you can check out there Using AddThis with Flash implementation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文