July 9, 2012

Simple share button for Tuenti

Tuenti is one of the most popular social networking among young people in Spain but unlike Facebook or Twitter does not have a a well documented API for Actionscript. Here we describe a method to share an URL with a text, or what is the same, to simulate the “Share” button inside a Flash application. First we define the data to post:

var text_to_share : String = "¡Hello World!";				
var url_to_share : String = "http://www.monday8am.com"

Next, we will publish the data using a simple URLVariables object:

var urlVariables : URLVariables = new URLVariables();
urlVariables.m = "Share";
urlVariables.func = "index";
urlVariables[ "suggested-text" ] = text_to_share;
urlVariables.url = url_to_share;

build the URLRequest object:

var request : URLRequest = new URLRequest( "http://www.tuenti.com/" );			
request.method = URLRequestMethod.GET;
request.data = urlVariables;

and finally:

navigateToURL( request , "_blank" );

The result is a new browser tab with the text and the URL to share. Voila

Post a Reply

Your email address will not be published. Required fields are marked *