1.  
  2. //------------------------------------------------------------------------------ POST TO WALL
  3. //*******************************************************************************************
  4. public function postToWall() : void
  5. {
  6. trace("postToWall : userHasPermission2Post "+userHasPermission2Post);
  7.  
  8. if (userHasPermission2Post)
  9. {
  10. var message : String = "Top priority message incoming from "+author.name+". \nView now and join his MAG Alliance";
  11.  
  12. var baseURL : String = SWFAddress.getBaseURL();
  13. baseURL = StringUtils.searchAndReplace(baseURL, "index2.html","index.php");
  14.  
  15. var urlVars:URLVariables = new URLVariables();
  16. urlVars.selLoc = main.SEL_LOC;
  17. urlVars.selLang = main.SEL_LANG;
  18. urlVars.viewID = main.selectedPMC;
  19. urlVars.aid = main.authorID;
  20. urlVars.player = main.selectedPMC;
  21. //get rid of the trailing slash
  22.  
  23. var playerLink : String = baseURL+"?"+urlVars.toString();
  24.  
  25. var actionLinkData:ActionLinkData = new ActionLinkData();
  26. actionLinkData.href = playerLink;
  27. actionLinkData.text = "MAG ALLIANCE";
  28.  
  29. //MAG LOGO
  30. var magLogo:StreamMediaData = new StreamMediaData();
  31. magLogo.type = MediaTypes.PHOTO;
  32. magLogo.href = playerLink;
  33. magLogo.src = Main.SITEURL+"images/facebook/mag_logo.jpg";
  34.  
  35.  
  36. var attachement : AttachmentData = new AttachmentData();
  37. attachement.href = playerLink;
  38. attachement.name = "MAG ALLIANCE";
  39. 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?");
  40.  
  41. attachement.media = [magLogo];
  42.  
  43. //message:String, attachment:Object = null, action_links:Array = null, target_id:String
  44. fbConnection.postOnWall(message,attachement,[actionLinkData],friend.uid);
  45. fbConnection.onPostPublished = onPostPublished;
  46. GoogleAnalyticsTracker.track("Facebook_postToWall");
  47. }
  48. else
  49. {
  50. checkForPermission();
  51. }
  52. }