2013-01-18 89 views
2

基本上,我目前正在使用Actionscript 3.0和AIR(Flash Pro 6)構建手機遊戲。我想添加一個Facebook分享按鈕,用戶可以將他們的成就發佈到他們的牆上。AIR ActionScript 3添加Facebook共享按鈕

該帖子將包含一些單詞和圖像。

我不知道從哪裏開始。有人可以幫忙嗎? THX B4 ......

+0

http://stackoverflow.com/questions/2511918/how-to-create-a-share-button-in-as3這應該這樣做 我覺得應該是相同的API。 –

回答

0

您可以使用此AS3代碼使用FB分享按鈕。

fbShareBtn.addEventListener(MouseEvent. CLICK, shareapp) 
function shareapp(evt:Event):void 
      { 

      var req:URLRequest = new URLRequest(); 
      req.url = "http://www.facebook.com/dialog/feed"; 
      var vars:URLVariables = new URLVariables(); 
      vars.app_id = "xxxxxxxxxxxx"; // your application's id 
      vars.link = "http://youromainhere"; 
      vars.picture = "http://yourimage"; 
      vars.name = "My Game"; 
      vars.caption = "My Score "; 
      //vars.description = "My score is " + String(score) + " Try and you!"; 
      vars.redirect_uri = "http://yourdomainhere"; 
      req.data = vars; 
      req.method = URLRequestMethod.GET; 
      navigateToURL(req, "_blank"); 

      }