Javascript swfobject未回拨swffit
我有一个可以读取一些FlashVar的flash对象,我需要安装最小尺寸为1000x600的flash对象。。如果较大,则应为100%x100%。 所以我使用swfit,我需要通过GET从php设置flashvars,flash内容是液态的。如果我使用100%宽度和100%高度,效果会很好,但正如我所说,如果使用1000x600以下的分辨率,flash对象上的某些元素看起来不好,下面是代码:Javascript swfobject未回拨swffit,javascript,swfobject,Javascript,Swfobject,我有一个可以读取一些FlashVar的flash对象,我需要安装最小尺寸为1000x600的flash对象。。如果较大,则应为100%x100%。 所以我使用swfit,我需要通过GET从php设置flashvars,flash内容是液态的。如果我使用100%宽度和100%高度,效果会很好,但正如我所说,如果使用1000x600以下的分辨率,flash对象上的某些元素看起来不好,下面是代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stri
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My HTML Title</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swffit.js"></script>
<script type="text/javascript">
var flashvars = {
section:" <?php if (isset($GET_['section'])) { echo $GET_['section']; } else { echo 'home'; } ?>",
previewid:" <?php if (isset($GET_['previewid'])) { echo $GET_['previewid']; } else { echo 'null'; } ?>",
previewlikes:" <?php if (isset($GET_['previewlikes'])) { echo $GET_['previewlikes']; } else { echo 'null'; } ?>",
previewdate:" <?php if (isset($GET_['previewdate'])) { echo $GET_['previewdate']; } else { echo 'null'; } ?>",
previewurl:" <?php if (isset($GET_['previewurl'])) { echo $GET_['previewurl']; } else { echo 'null'; } ?>"
};
var params = {
quality: "high",
scale: "noScale",
wmode: "transparent",
allowscriptaccess: "always",
bgcolor: "#000000"
};
var attributes = {
id: "Container",
name: "Container"
};
swfobject.embedSWF("Container.swf", "Container", "1000", "600", "9.0.0", false, flashvars, params, attributes, callbackHandler);
var callbackHandler = function (e)
{
if (e.success)
{
swffit.fit("Container",1000,600,2048,1536,false,false);
}
}
</script>
<style type="text/css">
body
{
background-color: #000000;
}
</style>
</head>
<body>
<div id="Container">
<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" title="Get Adobe Flash player"/></a><br/>
You need <a href="http://www.adobe.com/go/getflashplayer">Flash Player 9</a> and allow javascript to see the content of this site..
</div>
</body>
</html>
我的HTML标题
var flashvars={
第节:“,
预览:“”,
预览类:“,
预览日期:“,
预告片:“
};
变量参数={
质量:“高”,
音阶:“noScale”,
wmode:“透明”,
allowscriptaccess:“始终”,
bgcolor:#000000”
};
变量属性={
id:“容器”,
名称:“容器”
};
swfobject.embeddeswf(“Container.swf”、“Container”、“1000”、“600”、“9.0.0”、false、flashvars、params、attributes、callbackHandler);
var callbackHandler=函数(e)
{
如果(如成功)
{
swffit.fit(“容器”,100060020481536,假,假);
}
}
身体
{
背景色:#000000;
}
您需要并允许javascript查看此站点的内容。。
修复,对于有相同错误的人,这里有一个解决方案:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Title</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swffit.js"></script>
<script type="text/javascript">
var flashvars = {
section:" <?php if (isset($GET_['section'])) { echo $GET_['section']; } else { echo 'home'; } ?>",
previewid:" <?php if (isset($GET_['previewid'])) { echo $GET_['previewid']; } else { echo 'null'; } ?>",
previewlikes:" <?php if (isset($GET_['previewlikes'])) { echo $GET_['previewlikes']; } else { echo 'null'; } ?>",
previewdate:" <?php if (isset($GET_['previewdate'])) { echo $GET_['previewdate']; } else { echo 'null'; } ?>",
totalimages:" <?php if (isset($GET_['totalimages'])) { echo $GET_['totalimages']; } else { echo 'null'; } ?>"
};
var params = {bgcolor:"#000000"};
var attributes = {id: "flash"};
swfobject.embedSWF("Container.swf", "flash", "1000", "600", "9.0.0","",flashvars, params, attributes);
swffit.fit("flash",1000,600,2048,1536);
</script>
<style type="text/css">
body{
background-color: #000000;
}
</style>
</head>
<body>
<div id="flash">
<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" title="Get Adobe Flash player" /></a><br />
You need <a href="http://www.adobe.com/go/getflashplayer">Flash Player 9</a> and allow javascript to see the content of this site..
</div>
</body>
</html>
我的头衔
var flashvars={
第节:“,
预览:“”,
预览类:“,
预览日期:“,
总图像:“
};
var参数={bgcolor:#000000};
var属性={id:“flash”};
嵌入swf(“Container.swf”、“flash”、“1000”、“600”、“9.0.0”、“flashvars、params、attributes”);
swffit.fit(“闪光”,100060020481536);
身体{
背景色:#000000;
}
您需要并允许javascript查看此站点的内容。。