日期:2014-05-17  浏览次数:20905 次

请高手指教
Sub photo()
dim pics,links,texts
set rs=server.CreateObject("adodb.recordset")
msql="select top 5 * from hb-yc-sxgj where ViewFlag=1 and picture<>'' order by Id desc"
rs.open msql,conn


do while not rs.eof
pics= pics & Trim(rs("picture")&"") & "|"
links= links & rs("ggurl")&"|"
texts= texts & left(Trim(rs("ggname")&""),20) & "|"


rs.movenext
loop
if pics<>"" then pics=left(pics,len(pics)-1)
if links<>"" then links=left(links,len(links)-1)
if texts<>"" then texts=left(texts,len(texts)-1)
If rs.state<>0 Then rs.close
Set rs=nothing
Response.Write"<script type='text/javascript'>"
Response.Write"var swf_width=400;"
Response.Write"var swf_height=270;"
Response.Write"var config='3|0xFFFFFF|FD380B|50|0xffffff|0x0099ff|0x000000';"
Response.Write"var files="""&pics&""";"
Response.Write"var links="""&links&""";"
Response.Write"var texts="""&texts&""";"
Response.Write"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" 

codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ swf_width +'"" 

height=""'+ swf_height +'"">');"
Response.Write"document.write('<param name=""movie"" value=""images/focus.swf"" />');"
Response.Write"document.write('<param name=""quality"" value=""high"" />');"
Response.Write"document.write('<param name=""menu"" value=""false"" />');"
Response.Write"document.write('<param name=wmode value=""opaque"" />');"
Response.Write"document.write('<param name=""FlashVars"" 

value=""config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'"" />');"
Response.Write"document.write('<embed src=""images/focus.swf"" wmode=""opaque"" 

FlashVars=""config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu=""false"" 

quality=""high"" width=""'+ swf_width +'"" height=""'+ swf_height +'"" type=""application/x-shockwave-flash"" 

pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"
Response.Write"document.write('</object>');"
Response.Write"</script>"
End Sub

这是个调用FLASH图片新闻的代码,为什么除了第一张图片有超级连接,而后面几张都没有超级连接?

------解决方案--------------------
你贴这样的代码,不如贴你生成的html代码。

另外,后台生成的代码,直接生成到FlashVars里面就可以了,无需再生成什么这么多的js代码

另外,自己要学会调试程序,要知道为什么不起作用,很简单,查看你浏览器中的源代码是否跟正确的格式一致不就可以 了