asp 数组 flash动态读取数据库内容
<div><divclass="flash"><scripttype="text/javascript"><%DimimgUrl(1to3)AsStringDimimgt...
<div>
<div class="flash">
<script type="text/javascript">
<% Dim imgUrl(1 to 3) As String
Dim imgtext(1 to 3 ) As String
Dim imgLink(1 to 3) As String
set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 3 * from news where Img<>0 order by id asc"
rs.Open sql,conn,3,2
%>
<%
for i=1 to rs.Recordcount
if rs.Eof then Exit for%>
imgUrl(i)='admin/smallImg/rs("Img")';
imgtext(i)=''
imgLink(i)=escape('#');
<%rs.Movenext
next
rs.close
%>
var interval_time=5
var focus_width=338
var focus_height=250
var text_height=0
var text_align= 'center'
var swf_height = focus_height+text_height
var pics=imgUrl(1)+"|"+imgUrl(2)+"|"+imgUrl(3)
var links=imgLink(1)+"|"+imgLink(2)+"|"+imgLink(3)
var texts=imgtext(1)+"|"+imgtext(2)+"|"+imgtext(3)
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'">');
document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
表的结构式 ID Img
5 02.gif
路径是admin/smallImg/ Img默认是0
目的动态读取Img不为0的三个图片做为原图显示在ASP首页的FLASH中 展开
<div class="flash">
<script type="text/javascript">
<% Dim imgUrl(1 to 3) As String
Dim imgtext(1 to 3 ) As String
Dim imgLink(1 to 3) As String
set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 3 * from news where Img<>0 order by id asc"
rs.Open sql,conn,3,2
%>
<%
for i=1 to rs.Recordcount
if rs.Eof then Exit for%>
imgUrl(i)='admin/smallImg/rs("Img")';
imgtext(i)=''
imgLink(i)=escape('#');
<%rs.Movenext
next
rs.close
%>
var interval_time=5
var focus_width=338
var focus_height=250
var text_height=0
var text_align= 'center'
var swf_height = focus_height+text_height
var pics=imgUrl(1)+"|"+imgUrl(2)+"|"+imgUrl(3)
var links=imgLink(1)+"|"+imgLink(2)+"|"+imgLink(3)
var texts=imgtext(1)+"|"+imgtext(2)+"|"+imgtext(3)
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'">');
document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
表的结构式 ID Img
5 02.gif
路径是admin/smallImg/ Img默认是0
目的动态读取Img不为0的三个图片做为原图显示在ASP首页的FLASH中 展开
1个回答
展开全部
(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败(R) Flash(R) Player 安装失败
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询