我想做一个FLASH 焦点图实现最新的新闻首页图片显示在网上下载了个FLASH 焦点图 但在页面了 有这样的<script type="text/javascript">
imgUrl1="images/01.jpg";
imgtext1="蔬菜广告创意01"
imgLink1=escape("http://www.makewing.com");
imgUrl2="images/02.jpg";
imgtext2="蔬菜广告创意02"
imgLink2=escape("http://www.makewing.com");
imgUrl3="images/03.jpg";
imgtext3="蔬菜广告创意03"
imgLink3=escape("http://www.makewing.com");
imgUrl4="images/04.jpg";
imgtext4="蔬菜广告创意04"
imgLink4=escape("http://www.makewing.com");
imgUrl5="images/05.jpg";
imgtext5="蔬菜广告创意05"
imgLink5=escape("http://www.makewing.com"
);---- 我想实现由数据库中读取这些 具体代码怎么写,或是谁有更好的实现方法,希望具体点-----
谢谢大家
imgUrl1="images/01.jpg";
imgtext1="蔬菜广告创意01"
imgLink1=escape("http://www.makewing.com");
imgUrl2="images/02.jpg";
imgtext2="蔬菜广告创意02"
imgLink2=escape("http://www.makewing.com");
imgUrl3="images/03.jpg";
imgtext3="蔬菜广告创意03"
imgLink3=escape("http://www.makewing.com");
imgUrl4="images/04.jpg";
imgtext4="蔬菜广告创意04"
imgLink4=escape("http://www.makewing.com");
imgUrl5="images/05.jpg";
imgtext5="蔬菜广告创意05"
imgLink5=escape("http://www.makewing.com"
);---- 我想实现由数据库中读取这些 具体代码怎么写,或是谁有更好的实现方法,希望具体点-----
谢谢大家
然后在页面读这个xml文档就行了只能给你一个思路
我没这代码
public static string GetFlashNews(List<FlashNewsInfo> flashNewsList, int focuswWidth, int focusHeight,int textHeight)
{
StringBuilder text = new StringBuilder(2048);
int count=flashNewsList.Count;
text.Append("<a target=\"_self\" href=\"javascript:goUrl()\">\n");
text.Append("<script type=\"text/javascript\">\n");
if (flashNewsList != null && flashNewsList.Count > 1)//有flash新闻信息
{
StringBuilder links = new StringBuilder(1024);//链接地址
StringBuilder urls = new StringBuilder(1024);//图片url
StringBuilder texts = new StringBuilder(1024);//标题文字
links.AppendFormat("escape(\"NewsRead.aspx?CatalogId={0}&refId={1}\")", flashNewsList[0].CatalogId, flashNewsList[0].NewsId);
urls.Append(flashNewsList[0].ImageUrl);
texts.Append(flashNewsList[0].Subject);
for (int i = 1; i < flashNewsList.Count; i++)
{
links.AppendFormat("+\"|\"+escape(\"NewsRead.aspx?CatalogId={0}&refId={1}\")", flashNewsList[i].CatalogId, flashNewsList[i].NewsId);
urls.Append("|" + flashNewsList[i].ImageUrl);
texts.Append("|" + flashNewsList[i].Subject);
}
text.Append("var focus_width=" + focuswWidth + ";\n");
text.Append("var focus_height="+focusHeight+";\n");
text.Append("var text_height="+textHeight+";\n");
text.Append("var swf_height = focus_height+text_height;\n");
text.Append("var pics=\"" + urls.ToString() + "\";\n");
text.Append("var links=" + links.ToString() + ";\n");
text.Append("var texts=\"" + texts.ToString() + "\";\n");
text.Append("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=\"'+ focus_width +'\" height=\"'+ swf_height +'\">');\n");
text.Append("document.write('<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"movie\" value=\"focus.swf\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#ffffff\">');\n");
text.Append("document.write('<param name=\"menu\" value=\"false\"><param name=wmode value=\"opaque\">');\n");
text.Append("document.write('<param name=\"FlashVars\" value=\"pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'\">');\n");
text.Append("document.write('<embed src=\"pixviewer.swf\" wmode=\"opaque\" FlashVars=\"pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'\" menu=\"false\" bgcolor=\"#F0F0F0\" quality=\"high\" width=\"'+ focus_width +'\" height=\"'+ focus_height +'\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');\n");
text.Append("document.write('</object>');\n");
text.Append("</script>\n</a>");
}
else//没有flash新闻信息
{
text.Append("</script>\n</a>");
}
return text.ToString();
}
<script language='javascript'>
<%=GetFlashNews()%>
</script>