【问题标题】:ActionScript 3. Popup Facebook share button on game overActionScript 3. 游戏结束时弹出 Facebook 分享按钮
【发布时间】:2014-02-10 04:36:27
【问题描述】:

我正在为 Facebook 创建 Flash 游戏。现在游戏结束后它会打开带有分享按钮的新标签(建议在墙上分享用户的游戏分数)。

它应该在同一个游戏窗口上弹出带有分享按钮的窗口。

现在我在 ActionScript 3 中的代码是:

            function gameOver(evt:Event)
            {
            if (!m_iLives){
            var req:URLRequest = new URLRequest();
            req.url = "http://www.facebook.com/dialog/feed";
            var vars:URLVariables = new URLVariables();
            vars.app_id = "0000000000000"; // your application's id
            vars.link = "https://www.facebook.com/.......";
            vars.picture = "http:/pictureN.png";
            vars.name = "Name...!";
            vars.caption = "Caption";
            vars.description = "My score is " + String(score) + " Try and you!";
            vars.redirect_uri = "https://www.url.com";
            req.data = vars;
            req.method = URLRequestMethod.GET;
            navigateToURL(req, "_blank");
            }
}

【问题讨论】:

    标签: facebook actionscript-3 flash actionscript share


    【解决方案1】:

    对于真正的弹出窗口,我总是使用 ExternalInterface。下面的脚本将让您创建弹出窗口。确保 ExternalInterface 可用。要自定义弹出窗口的大小,请将 with 和 height 变量替换为您的尺寸

    ExternalInterface.call("window.open('" + url + "','PopUpWindow','width=" + width + ",height=" + height + ",toolbar=yes,scrollbars=yes')");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-09
      • 2016-04-03
      • 1970-01-01
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多