ActionScript 3. Popup Facebook分享游戏结束按钮

时间:2014-02-09 10:16:51

标签: facebook actionscript-3 flash actionscript share

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

newtab

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

share

现在,我在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");
            }
}

1 个答案:

答案 0 :(得分:0)

对于真正的弹出窗口,我总是使用ExternalInterface。下面的脚本将允许您创建弹出窗口。确保ExternalInterface可用。要自定义弹出窗口的大小,请将尺寸

替换为with和height变量
ExternalInterface.call("window.open('" + url + "','PopUpWindow','width=" + width + ",height=" + height + ",toolbar=yes,scrollbars=yes')");