0
votes

I'm creating flash game for Facebook. For now after Game Over It opens new tab with share button (suggest share user's game score on wall).

newtab

It should pop-up window with share button on the same Game window.

share

For now my code in ActionScript 3 is:

            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

1 Answers

0
votes

For true pop-ups I always use ExternalInterface. The script below will let you create pop-ups. make sure the ExternalInterface is available. And to customize the size of your pop-up replace the with and height variable with your dimensions

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