flash新闻展示

从数据库中查出图片信息,拼装成字符串
<script type="text/javascript">
window.onload = function(){
var imgs = "";
//var url;
    //var title = "";
<%
LashimgSrv ls = AppContext.getBean(LashimgSrv.class);
List<Lashimg> list = ls.queryObjs(Cnd.where("state", "=", 1).asc(
"sno"));
for (Lashimg li : list) {%>
imgs += "<%=pathStr%><%=li.getUrl()%>" + "|";
<%}%>
if(imgs.length > 10){
imgs = imgs.substring(0,imgs.length-1);
}
var focus_width202 = 1000;
        var focus_height202 = 200;
        var text_height202 = 0;//显示文本高度
        var swf_height202 = focus_height202 + text_height202;

        var pics202 = imgs;
        var htmlStr = "";
       //  var links202 = url;
        //图片对应的网站
     //   var texts202 = title;
        htmlStr += "<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=\"" + focus_width202 + "\" height=\"" + swf_height202 + "\">";
        /*这里必须填写flash.swf的正确路径*/
        htmlStr += "<param name=\"allowScriptAccess\" value=\"sameDomain\"/><param name=\"movie\" value=\"<%=pathStr%>/img/flash.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"bgcolor\" value=\"white\"/>";
        htmlStr += "<param name=\"menu\" value=\"false\"/><param name=wmode value=\"opaque\"/>";
        htmlStr += "<param name=\"FlashVars\" value=\"pics=" + pics202 + "&borderwidth=" + focus_width202 + "&borderheight=" + focus_height202 + "&textheight=" + text_height202 + "\"/>";
        htmlStr += "<embed src=\"<%=pathStr%>/img/flash.swf\" wmode=\"opaque\" FlashVars=\"pics=" + pics202 + "&borderwidth=" + focus_width202 + "&borderheight=" + focus_height202 + "&textheight=" + text_height202 + "\" menu=\"false\" bgcolor=\"white\" quality=\"high\" width=\"" + focus_width202 + "\" height=\"" + swf_height202 + "\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
        htmlStr += "</object>";
       
      var flashdiv =  document.getElementById("imageflash");
      flashdiv.innerHTML=htmlStr;
     
   
}
</script>

你可能感兴趣的:(Flash,Go)