Wednesday, August 26, 2009

Using ShareThis in Flex-Flash


Wondering when ShareThis would actually provide a .swf file to be loaded in the fash file in stead of calling a JavaScript function to open the ShareThispop in the new window.
First of all we need to go to sharethis.com publisher section and customize your widget, you will get a javascript code by registering your email address. Here is javascript code what i got :-

script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=9f363e20-dc32-444d-a8c9-afd21615fd57&type=website&popup=true&embeds=true">






// ACTIONSCRIPT CODE
private function shareThis():void
{
var url:String = "http://www.vrathore.blogspot.com";
var title:String = "VARUN-RATHORE";
ExternalInterface.call("ShareThis", url, title);
}


Using a javascript code in the html file for opening the pop window
// JAVASCRIPT CODE
function ShareThis(url, title)
{
url = window.location;
var s = SHARETHIS.addEntry({
url: url,
title: title
}, {button:false,popup:true});
s.popup()
return false;
}


Cheers

Varun Rathore

1 comment:

Unknown said...

Hi VRathore's,

i am trying to integrate sharethis in flash,.
i follow the procedures what u mention in Using ShareThis in Flex-Flash,the problem is that the posting message title not showing waht i return from flash,it only shows relative path

About Me