HI Folks,
我正在尝试在客户的网页上显示一个简单的Flash电影
ilogicconcepts.com.sg
出于某种原因,电影只是拒绝加载,并且绝对不是权限问题,因为我可以到http://ilogicconcepts.com.sg/media/home.swf直接观看电影。
我检查过firebug,看起来页面甚至没有尝试加载电影。对此有任何想法将非常感激。
感谢的。
答案 0 :(得分:0)
我认为你应该使用SWFObject。您可以从此处下载js文件和expressinstall文件:http://code.google.com/p/swfobject/downloads/detail?name=swfobject_2_2.zip&can=2&q= 您需要js文件进行嵌入,并且expressinstall.swf会自动更新用户Flash Player(如果它早于需要时)。您可以设置最小播放器版本,向Flash添加自定义变量,还可以设置Flash影片的参数和属性。有关更多详细信息,请参阅swfobject文档。
我修改了你的代码,所以如果你把swfobject.js文件放到js文件夹和expressinstall.swf文件到你的媒体文件夹,并用下面的代码替换你的代码,它应该可以正常工作。我在FF3和Chrome上测试过,它对我有用。
代码:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/css/style.css" /> <link rel="stylesheet" type="text/css" href="/js/lightbox/css/lightbox.css" />
<title>Welcome to Ilogic Concepts Singapore.</title>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3702519-11']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
function initFlash()
{
var flashvars = {};
var params = {
allowScriptAccess: "sameDomain"
};
var attributes = {};
swfobject.embedSWF("media/home.swf", "flashcontent-home", "450", "338", "9.0.0", "media/expressInstall.swf", flashvars, params, attributes);
swfobject.createCSS("#flashcontent-home", "width:450px; height:338px; float:left; margin-right:10px;");
}
</script>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="main">
<script type="text/javascript" src="/js/jquery.js"></script><script type="text/javascript" src="/js/jclock.js"></script>
<div id="nav-wrapper">
<div class="jclock"></div>
<ul id="nav">
<li><a href="/">HOME</a></li>
<li><a href="/about">ABOUT US</a></li>
<li><a href="/services">SERVICES</a></li>
<li><a href="/portfolio">PORTFOLIO</a></li>
<li><a href="/contact">CONTACT US</a></li>
</ul>
</div>
<script type="text/javascript">
$(function($) {
$('<img src="/img/button-bg-alt.png" alt="" />');
$('.jclock').jclock({
format: '%A, %d.%m.%Y - %H:%M:%S'
});
});
</script>
<div id="content">
<div class="heading-page">HOME</div>
<div id="homeWelcome">
<div id="flashcontent-home"></div>
<div id="passage">
Welcome,<br/><br/>
We believe that good design <br/>
is timeless in both <br/>
function and nature. <br/><br/>
Through years of experience, <br/>
we create rooms that reflect <br/>
our clients' individual <br/>
needs and personal style.
</div>
</div>
</div>
</div>
<div id="footer"></div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3702519-11']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
initFlash();
</script>
</body>
</html>
祝你好运,
罗布