A share in facebook question
Guys...
I was looking for a way to share in facebook a score a user can make playing a game...
I found this website: http://www.actionscript.org/resources/blogs/52/Facebook-and-Twitter-buttons-in-Flash-and-Flex.html so I went ahead and copied the code, modified it and placed in my actionscript...
However it shares the webpage I put in the link, but it does not put the text...and, also, what I would like it to say is something like: Can you beat my score of (count)? ...
Now, is it possible with something like this? What should I add?
Here is the code: (count is the var where I have the score made in the game)
if (espanol) addChild(botonface);
if (ingles) addChild(btnface);
btnface.addEventListener(MouseEvent.CLICK, goFace);
botonface.addEventListener(MouseEvent.CLICK, goFace);
function goFace(e:MouseEvent):void {
btnface.removeEventListener(MouseEvent.CLICK, goFace);
botonface.removeEventListener(MouseEvent.CLICK, goFace);
socialUpdate("facebook", "Can you beat my score", "www.google.com");
}
function socialUpdate(site:String, text1:String = "", link:String = "")
{
var siteURL:String;
var maxLength:Number;
switch (site) {
case "facebook":
maxLength = 255;
break;
default:
return;
break;
}
var availableTextLength:Number = maxLength - (link.length + 1);
if (text1.length > availableTextLength) {
text1 = text1.substr(0, (availableTextLength - 3)) + '...';
}
switch (site) {
case "facebook":
siteURL = "http://www.facebook.com/share.php?u=" + encodeURIComponent(link) + "&t=" + encodeURIComponent(text1);
break;
}
var urlRequest:URLRequest = new URLRequest(siteURL);
navigateToURL(urlRequest, "_blank");
}
