...

View Full Version : Game is okay in IE but not in Firefox or Chrome



andrewvan
10-02-2012, 02:54 PM
Flash game is ok in IE but in Google Chrome or Firefox the game opens up in a specified window size but the game itself which is flash, is a small image at top left within the window size. for example like placing a postage stamp on top left hand corner of a sheet of A4 paper, instead of the postage stamp filling the whole screen like it does correctly in IE. Code is shown below that launches the games.


<?
/***********************************************************************

GAME LAUNCHER v1.0
************************************************************************/
Error_Reporting(0);
unset($l);
session_start();
session_register($l);
include ("includes/config.php");
include ("dbcon.php");
if(isset($l)){
if ($mode=="fun" && $l!="guestlogin")
{
$loginkey=md5(rand(00000000000000000,999999999999999999));
$loginkey=strtoupper($loginkey);
$js_username="$l";
$js_password="$p";
mysql_query("INSERT INTO `jsgamingcenter_loginkeys` VALUES('$loginkey', 'PLAY FOR FUN RELOGIN', '$js_username', '$js_password')", $casdb);
$relogin="1";
} }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><? echo "$casinoname"; ?> Casino/Games</title>
<style type="text/css">
<!--
.style1 {
font-size: x-small;
font-weight: bold;
}
-->
</style>
<script language="javascript">
function openerRefresh(){
//allow refresh of parent window unless parent is closed, if any exception if caught (by changing parent window domain) then do not refresh and close popup
try {
if (!window.opener.closed) {
openerUrl=window.opener.location.href;
//no need to add refresh=true to the url if its already there
if (!(openerUrl.indexOf("refresh=true") > -1)) {
if (openerUrl.indexOf("#") > -1) {
openerUrl = openerUrl.replace("index.php","?refresh=true&relogin=<? echo "$relogin"; ?>&loginkey=<? echo "$loginkey"; ?>");
} else {
if(openerUrl.indexOf("?") == -1) {
openerUrl += "?refresh=true";
} else {
openerUrl += "&refresh=true";
}
}
}
window.opener.location.href=openerUrl;
}
} catch(e) {
self.close();
}
}
</script>
<SCRIPT language="javascript">
// writes the flash embedding tags using javascript, as required by MS's patent-busting IE "update"
function embedSwf(target, swf, base, width, height) {
d = document.getElementById( target );
d.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" id="mapcontrols">' +
'<param name="movie" value="' + swf + '">' +
'<param name="quality" value="high">' +
'<param name="menu" value="false">' +
'<param name="allowFullScreen" value="true" >' +

'<param name="base" value="' + base + '">' +
'<embed src="' + swf + '" menu="false" swLiveConnect="true" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + '" name="mapcontrols" base="' + base + '">' +
'</embed>' +
'</object>';
}
</SCRIPT>
<script type="text/javascript" language="JavaScript">
function resizeTo(w,h) {
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {








} else {
window.resizeBy(w-document.body.clientWidth, h-document.body.clientHeight);
}
self.focus();
}
}
</script>
</head>
<?
$gamedet=mysql_fetch_array(mysql_query("select * from jsgamingcenter_games where id='$game'", $casdb));
$game_status=$gamedet["status"];
$game_id=$gamedet["id"];
$game_name=$gamedet["name"];
$game_width=$gamedet["width"];
$game_height=$gamedet["height"];
$game_location=$gamedet["location"];
$game_basedir=$gamedet["base_directory"];
if($game_id!=$game){
echo "ERROR gc_g1 - Game does not exist!";
exit;
}
if($game_status!="1"){
echo "ERROR gc_g2 - Game not availible!";
exit;
}
if(isset($l)){
$luserdet=mysql_fetch_array(mysql_query("select * from jsgamingcenter_users where login='$l'", $casdb));
if ($mode=="real" && $luserdet[24]!="1"){
echo "<div align=\"center\" class=\"style1\">You cannot &quot;Play For Real&quot; because your account is not currently in an active state! </div>";
exit;}}
if(!isset($l)){
if ($mode=="real") {
echo "<div align=\"center\" class=\"style1\">Please log into your $casinoname account in order to start a &quot;Play For Real&quot; Game! </div>";
exit;
}
}
if(isset($l)){
if ($mode=="fun") {
unset($l);
session_destroy();
session_start();
mysql_query("UPDATE jsgamingcenter_users set cash='5000' where login='guestlogin'", $casdb);
$HTTP_SESSION_VARS['l']=guestlogin;
$HTTP_SESSION_VARS['p']=guestlogin;
}
}
if(!isset($l)){
if ($mode=="fun") {
session_start();
mysql_query("UPDATE jsgamingcenter_users set cash='5000' where login='guestlogin'", $casdb);
$HTTP_SESSION_VARS['l']=guestlogin;
$HTTP_SESSION_VARS['p']=guestlogin;
}
}
if(isset($l)){
if ($mode=="real" && $l=="guestlogin") {
echo "<div align=\"center\" class=\"style1\">Please log into your $casinoname account in order to start a &quot;Play For Real&quot; Game! </div>";
exit;
}
}
echo "
<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" scroll=\"no\" onUnload=\"openerRefresh()\">
<script language=\"javascript\">
top.resizeTo($game_width, $game_height);
</script>
<span id=\"swfTarget\">
<script>embedSwf( \"swfTarget\",
\"$game_location\",
\"$game_basedir\",
\"100%\",
\"100%\" );
</script></span>
</body>
";
?>

Amadeo
12-02-2012, 11:46 AM
I think you are using an outdated version of the browser. I used the code on a friv (http://www.frivspace.com) test page and works good on all browsers. You can ask a friend from a diferent computer to take a look.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum