//------------------------------------------------------------------------------ POST TO WALL
//*******************************************************************************************
public function postToWall() : void
{
trace("postToWall : userHasPermission2Post "+userHasPermission2Post);
if (userHasPermission2Post)
{
var message : String = "Top priority message incoming from "+author.name+". \nView now and join his MAG Alliance";
var baseURL : String = SWFAddress.getBaseURL();
baseURL = StringUtils.searchAndReplace(baseURL, "index2.html","index.php");
var urlVars:URLVariables = new URLVariables();
urlVars.selLoc = main.SEL_LOC;
urlVars.selLang = main.SEL_LANG;
urlVars.viewID = main.selectedPMC;
urlVars.aid = main.authorID;
urlVars.player = main.selectedPMC;
//get rid of the trailing slash
var playerLink : String = baseURL+"?"+urlVars.toString();
var actionLinkData:ActionLinkData = new ActionLinkData();
actionLinkData.href = playerLink;
actionLinkData.text = "MAG ALLIANCE";
//MAG LOGO
var magLogo:StreamMediaData = new StreamMediaData();
magLogo.type = MediaTypes.PHOTO;
magLogo.href = playerLink;
magLogo.src = Main.SITEURL+"images/facebook/mag_logo.jpg";
var attachement : AttachmentData = new AttachmentData();
attachement.href = playerLink;
attachement.name = "MAG ALLIANCE";
attachement.description = main.trans.translate("Target the friend you want to join your MAG Alliance. Does your ideal comrade have indomitable fighting spirit, battlefield intelligence or an indefatigable commitment to the cause?");
attachement.media = [magLogo];
//message:String, attachment:Object = null, action_links:Array = null, target_id:String
fbConnection.postOnWall(message,attachement,[actionLinkData],friend.uid);
fbConnection.onPostPublished = onPostPublished;
GoogleAnalyticsTracker.track("Facebook_postToWall");
}
else
{
checkForPermission();
}
}