<div align="center">
<span class="phonecenter" style="z-index:-1">
<object id="cateIcon_0" name="cateIcon" height="170" width='170' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
<param name="movie" value="../../images/1.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name = "allowScriptAccess" value = "always" />
</object>
</span>
<div id="masker1" style="cursor: hand; margin-top:-180px; width:170px; height:170px; z-index:1; visibility: visible;">
<a href="PhoneIndex.aspx?categoryid=1">
<img src="../../images/trans.gif" style="border:0;" alt="" width="170" height="170"/>
</a>
</div>
</div>
这样的flash 一共有2行4列。 我在上面加了个层 ,为的是控制flash的连接 。
但现在要让 flash循环动起来。我就写了段js
var cates=document.getElementsByName("cateIcon");
var i=0;
function playIcons(){
if(cates[i])
{
cates[i].StopPlay();
}
for(i=0;i<cates.length;i++)
{
cates[i].Play();
//alert(cates[i].IsPlaying());
if(i>cates.length-1){
i=0;
}
}
}
function onLoadCompelete(){
if(7 > 0){
setInterval("playIcons()",3500);
}
}
window.onload=onLoadCompelete;我 alert 出动画 IsPlaying 都是 true 但为什么页面上动画就是不动呢?大家帮我看看啊!!!
你这段for循环是想让所有的FLash同时播放啦,而且这句
if(i>cates.length-1){
i=0;
}
好像是多余的。
楼主说的循环播放应该是第一个播放完毕,停下来,再播放第二个吧?
如果是这样的话,需要捕捉Flash播放完毕的信号了,没做过,所以无法提供详细方法了。
楼主解决以后别忘了贴上来,让我学习一下。
var i=0;
function playIcons(){
if(cates[i])
{
cates[i].StopPlay();
}
cates[i].Play();
//alert(cates[i].IsPlaying());
if(++i>cates.length-1){
i=0;
}
}
function onLoadCompelete(){
if(7 > 0){
setInterval("playIcons()",3500);
}
}
window.onload=onLoadCompelete;不过还是不行 ...