Hi Daniel!
No problem, thanks for fixing the link. I'm going to take a moment to update our index.template.html file because it's starting to look old and I'm pretty sure we've got some old/deprecated/duplicated code.
Our template is quite a complex file because we use the same Flash Builder project for both 'Flash' platforms (Facebook & Kongregate), so we show one content or another depending on some Javascript functions that tells the html file whether the player is on one platform or another.
I was actually checking Kongregate Developers's documentation (https://docs.kongregate.com/docs/concepts-flash-iframe-integration) and it's already changed since the last time (it's suggesting now to use document.write though). On the other hand a surprise: Facebook documentation (https://developers.facebook.com/docs/games/gamesonfacebook/webtech) has directly "deleted" the information on how to integrate Flash games on html files with the excuse that Flash is dying in 2020, sad.
I'm going to paste here our current html file (without the footer and header code), and will paste the final version of it (as soon as it's all fixed and double-checked that works on every platform) since I understand there will be people in a future that will need it, specially if they publish on these two platforms as well.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en" xml:lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<script type="text/javascript">
var v = "\?v=1.5.2.709";
var platform="fb";
<!-- @return whether the current platform is Facebook or not -->
function isFacebook(){return platform == "fb";}
</script>
<!-- Add FACEBOOK Script (Conditionally) -->
<script type="text/javascript">
if(isFacebook())
{
var platformScript = document.createElement("script");
platformScript.type = "text/javascript";
platformScript.src = "https://connect.facebook.net/en_US/all.js";
document.getElementsByTagName("head")[0].appendChild(platformScript);
}
</script>
<title>${title}</title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include CSS -->
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: #000000; }
object:focus { outline:none; }
#flashContent { display:none; box-shadow:0px 0px 60px black;}
</style>
<!-- Include support libraries first -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript" src="https://www.kongregate.com/javascripts/kongregate_api.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var cssStyle = (isFacebook()) ? "display:block;text-align:left;box-shadow:0px 0px 60px;" : "display:block;text-align:left;";
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "${expressInstallSwf}";
var flashvars = (isFacebook()) ? {} : kongregateAPI.flashVarsObject();
var params = {};
params.quality = "high";
params.bgcolor = "${bgcolor}";
params.allowscriptaccess = "always";
params.allowfullscreen = "true";
params.allowFullScreenInteractive = "true";
params.wmode = "direct";
var attributes = {};
attributes.id = "${application}";
attributes.name = "${application}";
attributes.align = "middle";
swfobject.embedSWF(
"${swf}.swf" + v, "flashContent",
"${width}", "${height}",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", cssStyle);
</script>
<style media="screen" type="text/css">#flashContent {box-shadow:0px 0px 60px black} </style>
</head>
<body id="body" onload="init()">
<div id="fb-root"></div>
<script>(function(d, s, id) {
if(isFacebook())
{
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.9&appId=FB_APP_ID";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'facebook-jssdk'));</script>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
when JavaScript is disabled.
-->
<center>
<div style="box-shadow:0px 0px 60px; -moz-box-shadow: 0px 0px 60px; -webkit-box-shadow: 0px 0px 60px; width:800px;">
<div id="flashContent">
<p>
To view this page ensure that Adobe Flash Player version
${version_major}.${version_minor}.${version_revision} or greater is installed.
</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.getElementById('flashContent').innerHTML = "<img src='"
+ pageHost + "d1qzmgnbw7y2pl.cloudfront.net/wwiitcg/share/share_game.jpg' width='58%' height='58%' alt='Get Adobe Flash player' />";
</script>
</div>
</div>
</center>
<div id="kong" style="display:none">
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="FSPreloader">
<param name="movie" value="FSPreloader.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="direct"/>
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FSPreloader.swf" width="800" height="600">
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="direct"/>
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
11.1.0 or greater is not installed.
</p>
<!--<![endif]-->
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</noscript>
</div>
<!--Add platform components -->
<center style="margin-top:5px;">
<script>
function init()
{
if(isFacebook())
{
randomize();
}
//Check the visibility
checkVisibilityByPlatform();
}
<!-- Determines the visibility of some components of the HTML depending on the current platform -->
function checkVisibilityByPlatform()
{
var elem = document.getElementById("body");
elem.style = (isFacebook()) ? "background-image: url('data/bg.jpg" + v + "');background-size: cover;background-repeat: no-repeat;background-position: center;" : "";
elem.style = (isFacebook()) ? "background: url('data/bg.jpg" + v + "');background-size: cover;background-repeat: no-repeat;background-position: center;" : "";
var elem = document.getElementById("fb-root");
elem.style.display = (isFacebook()) ? 'initial' : 'none';
var elem = document.getElementById("kong");
elem.style.display = (!isFacebook()) ? 'initial' : 'none';
}
</script>
</center>
</body>
</html>
Like I said, I'm pretty sure there's some code duplicated in this one, I'll post here the details.
Thanks for your time as always,
Chris