I’m trying to share my page with twitter, making the call from flash. I have succesfully called the function that brings the pop up window. I’m using Externalinterface object(ActionScript 3).
//---- What works—//
function tweet(){
// calls a popup window with the tweet dialog.
window.open(
'https://twitter.com/share?text=Some%20default%20text',
'twt',
'width=600,height=270'
);
}
function getFlashMovie(movieName) {
// gets the Flash object. Method changes with user browser.
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
//---------------- What doesn’t work ----------------//
twt.ready(function (twttr) {
// bind events here
twt.events.bind('tweet', function(event) {
// Do something there
alert('tweeeet !!');
// calls the actionscript function "sendToActionscript" declared inside the Flash
// the function gets the parameter "tweet",
getFlashMovie("flash").sendToActionscript('tweet');
});
});
It should show an alert window displaying "tweeeet !!" when the user shared my page on his tweet. I have to track this because the user gets a reward when sharing the page.