【http://zhidao.baidu.com/question/66356101.html】
小弟遇到两个问题:
1.如何控制网页中FLASH在打开网页后只播放一次?代码怎么写?
2.FLASH浮动在网页左下角之后,网页滚动条能一直往拉下,怎么解决?代码怎么写?
请各位大哥帮帮我.我需要具体的代码,谢谢!
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<html>
<head></head>
<body bgcolor="#000000">
<!--浮动FLASH-->
<script>
var hbcms_ad_width = 105;
var hbcms_left_ad = '<EMBED left="0" top="1500" height="750" wmode="transparent" loop="stop()" pluginspage=http://www.macromedia.com/go/getflashplayer
src=http://ad.glasses.com.cn/upswf/7c89ab0ed0e73874456eaecfa765bcca.swf type=application/x-shockwave-flash width=280
quality="high"></EMBED>';
hbcms_left_ad;
var hbcms_right_ad ="";
var delta=0.8;
var collection;
var closeB=false;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:'+hbcms_ad_width+'px;
height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',30);
}
}
function play()
{
if(screen.width<=800 || closeB)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
function closeBanner()
{
closeB=true;
return;
}
var theFloaters = new floaters();
theFloaters.addItem('followDiv1','document.body.clientWidth-106',hbcms_ad_width,hbcms_right_ad);
theFloaters.addItem('followDiv2',6,hbcms_ad_width,hbcms_left_ad);
theFloaters.play();
</script>
</body>
</html>
第一种方法:最后加上stop();
第二种方法:FLASH播放一次在FLASH里面写AS,停止或则自己关闭