首页 > 学习笔记 > 网页中FLASH滚动的对联广告源码
2007
03-01

网页中FLASH滚动的对联广告源码

//HTML文件

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body topmargin="0" marginwidth="0" >
<script language=JavaScript src="js/menus.js"></script>
<SCRIPT language=JavaScript event=FSCommand() for=c114l>floater.style.visibility='hidden';</SCRIPT>
<SCRIPT language=JavaScript event=FSCommand() for=c1142>floater1.style.visibility='hidden';</SCRIPT>
<DIV id=floater1 style="Z-INDEX: 100; VISIBILITY: visible; WIDTH: 115px; POSITION: absolute; TOP: 236px; left: 0px; height: 150px;">
<div align="center">
<EMBED src='swf/duilian.swf' quality=high wmode=opaque WIDTH=100 HEIGHT=150 TYPE='application/x-shockwave-flash' id=c1142></EMBED>
</div>
</DIV>

<DIV id=floater
style="Z-INDEX: 100; RIGHT: 0px; VISIBILITY: visible; WIDTH: 110; POSITION: absolute; TOP: 236; height: 150px;">
<div align="center">
<EMBED src='swf/duilian.swf' quality=high wmode=opaque WIDTH=100 HEIGHT=150 TYPE='application/x-shockwave-flash' id=c114l></EMBED>
</div>
</DIV>

<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>

//menus.js文件

self.onError = null;

currentX = currentY = 0;

whichIt = null;

lastScrollX = 0; lastScrollY = 0;

NS = (document.layers) ? 1 : 0;

IE = (document.all) ? 1: 0;

<!– STALKER CODE –>

function heartBeat(objectid) {

if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }

if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }

if(diffY != lastScrollY) {

percent = .1 * (diffY – lastScrollY);

if(percent > 0) percent = Math.ceil(percent);

else percent = Math.floor(percent);

if(IE) {

objectid = objectid.split(";");

for (i = 0; i < objectid.length; i++) eval("document.all."+objectid).style.pixelTop += percent;

}

if(NS) {

objectid = objectid.split(";");

for (i = 0; i < objectid.length; i++) eval("document."+objectid).top += percent;

}

lastScrollY = lastScrollY + percent;

}

if(diffX != lastScrollX) {

percent = .1 * (diffX – lastScrollX);

if(percent > 0) percent = Math.ceil(percent);

else percent = Math.floor(percent);

if(IE) {

objectid = objectid.split(";");

for (i = 0; i < objectid.length; i++) eval("document.all."+objectid).style.pixelLeft += percent;

}

if(NS) {

objectid = objectid.split(";");

for (i = 0; i < objectid.length; i++) eval("document."+objectid).left += percent;

}

lastScrollX = lastScrollX + percent;

}

}

<!– /STALKER CODE –>

if(NS || IE) action = window.setInterval("heartBeat('floater;floater1')", 2);

//swf文件按钮的代码

on (release)
{
getURL("FSCommand:");
}

注意图层的坐标有什么区别!
注意SWF文件在网页中的代码和平时的区别!

下载源文件:
uploads/200703/02_115215_1xp4_dl.rar

最后编辑:
作者:admin
这个作者貌似有点懒,什么都没有留下。

留下一个回复