Flash无法在Google Chrome中正确调整大小

时间:2012-07-15 12:40:16

标签: html flash google-chrome

我正在尝试查看谷歌浏览器中的agames但是在查看时,窗口大小很好,但游戏本身是窗口左上方的一个小男孩,窗口的其余部分是白色而不是填充整个窗口的游戏。这些游戏在IE上运行良好。根据用户选择的游戏,游戏有各种尺寸640x480或800x600,因此启动游戏时的代码如下所示。请在谷歌测试中提供帮助,而不是800x600的游戏我得到一个800x600的窗口,但游戏是窗口左上角的一个小“缩略图”

PHP

<?php
  /***********************************************************************
     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>
";
?>

0 个答案:

没有答案