Question

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

Was it helpful?

Solution

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&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>

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top