var pics='&co(0)&'  ??加链接符是什么意思?

解决方案 »

  1.   

    var pics='&co(0)&' 
    var links='&co(0)&' 
    var texts='+&ti(0)&+' 
    我就这3段不会写 不知道怎么写~
      

  2.   

    输出js数组啊  <% 
      dim rsa,sqla,k,ti(),co() 
    for i = 0 to 5 
    ReDim Preserve ti(i) 
    ReDim Preserve co(i) 
    ti(i)=i 
    co(i)=i 
    next set rsa=server.createobject("adodb.recordset") 
    sqla="select top 5 * from tupian where IsElite=1" 
    rsa.open sqla,conn,1,1 
    k=0 
      do while not rsa.eof 
      ti(k)=rsa("Content") 
      co(k)=rsa("DefaultPicUrl") 
      rsa.movenext 
      k=k+1 
      loop 
      rsa.close 
      %> 
      
      <script type="text/javascript"> 
    <!-- var focus_width=323 
    var focus_height=220 
    var text_height=20 
    var swf_height = focus_height+text_height 
    //================================================
    var pics=new Arrary()
    var links=new Arrary()
    var texts=new Arrary()
    <%
    for i=0 to ubound(ti)
      response.write "pics.push('"&co(i)&"');"&vbnewline
      response.write "links.push('"&co(i)&"');"&vbnewline
      response.write "texts.push('"&replace(ti(i),"'","\'")&"');"&vbnewline
    next
    %>
    //================================================document.write(' <object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); 
    document.write(' <param name="allowScriptAccess" value="sameDomain"> <param name="movie" value="images/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+'">'); 
    document.write(' <embed ID="focus_flash" src="images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
    document.write(' </object>'); //--> 
    </script>
      

  3.   

    如果用的大众版(就是网上好多网站采用的一种flash焦点效果)他的格式应该是这样的
      var pics='图片路径|图片路径' 
    var links='链接地址|链接地址' 
    var texts='链接文字|链接文字'内容是一一对应的...
      

  4.   

    我用上面的做了下 Flash好象都不显示了
      

  5.   

    Set rs = CreateObject("adodb.recordset")
     rs.CursorLocation = 3
     rs.open "select top 5 * from tupian where IsElite=1" 
     If Not (rs.eof and rs.bof) Then
       arr = rs.GetRows()
     End If
     rs.close
     set rs = Nothing
    就这样就能直接得到数组
    没有必要自己组合数组
      

  6.   

    你的flash接受的数据格式是什么,生成对应的格式
      

  7.   

    var pics=new Array(<%=UBound(arr,2)%>);
    var links=new Array(<%=UBound(arr,2)%>);
    var texts=new Array(<%=UBound(arr,2)%>);
    这样定义那么就是一个数组了
      

  8.   


      var pics='图片路径|图片路径' 
    var links='链接地址|链接地址' 
    var texts='链接文字|链接文字' 内容是一一对应的...他原来是是这样 网上找的代码 我想把这里改成读取数组的值
      

  9.   

    <%Set rs = CreateObject("adodb.recordset")
     rs.CursorLocation = 3
     rs.open "select top 5 * from tupian where IsElite=1" 
     If Not (rs.eof and rs.bof) Then
       arr = rs.GetRows()
     End If
     rs.close
     set rs = Nothing
    %>
    <script>var pics; 
    var links; 
    var texts; 
    for(var j=0;j<=<%=UBound(arr,2)%>;j++){
    if(pic==""){
    pics="<%=arr(1,i)%>"//1是代表你图片字段在数据库中的位置
    links="<%=arr(2,i)%>"//2是代表你URL字段在数据库中的位置
    texts="<%=arr(3,i)%>"//3是代表你标题字段在数据库中的位置
    }
    else{
    pics=pics+"|"+"<%=arr(1,i)%>"//1是代表你图片字段在数据库中的位置
    links=links+"|"+"<%=arr(2,i)%>"//2是代表你URL字段在数据库中的位置
    texts=texts+"|"+"<%=arr(3,i)%>"//3是代表你标题字段在数据库中的位置
    }
    }
    document.write(' <object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); 
    document.write(' <param name="allowScriptAccess" value="sameDomain"> <param name="movie" value="images/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+'">'); 
    document.write(' <embed ID="focus_flash" src="images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
    document.write(' </object>'); 
    </script> 试试看效果,我随手写的
      

  10.   

    呵呵,粗心
    for(var j=0;j<=<%=UBound(arr,2)%>;j++){
    这里应该是i
      

  11.   

    var focus_width=323 
    var focus_height=220 
    var text_height=20 
    var swf_height = focus_height+text_height 
    呵呵,你这部分我没复制进去,自己复制进去就可以了
      

  12.   

    那你连接成它的数据格式啊,你定义数组干吗
    <% 
      dim rsa,sqla,k,ti,co'=========ti="":co=""
    set rsa=server.createobject("adodb.recordset") 
    sqla="select top 5 * from tupian where IsElite=1" 
    rsa.open sqla,conn,1,1 
      do while not rsa.eof 
      '连接成需要的数据
      ti=ti&"|"&replace(rsa("Content"),"'","\'")
      co=co&"|"&rsa("DefaultPicUrl") 
      rsa.movenext 
      loop 
      rsa.close 
    if ti<>"" then ti=right(ti,len(ti)-1)
    if co<>"" then co=right(co,len(ti)-1)
      %> 
      
      <script type="text/javascript"> 
    <!-- var focus_width=323 
    var focus_height=220 
    var text_height=20 
    var swf_height = focus_height+text_height 
    //================================================
    var pics='<%=co%>'
    var links='<%=co%>'
    var texts='<%=ti%>'
    //================================================document.write(' <object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); 
    document.write(' <param name="allowScriptAccess" value="sameDomain"> <param name="movie" value="images/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+'">'); 
    document.write(' <embed ID="focus_flash" src="images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
    document.write(' </object>'); //--> 
    </script>
      

  13.   


    那要改flash里的as吧,他里面肯定 split了