标题:滚动图片怎么不行啊
只看楼主
subway2008
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2006-3-15
 问题点数:0 回复次数:2 
滚动图片怎么不行啊

本来是这样的
<script type="text/javascript">
imgUrl1="images/01.jpg";
imgtext1="试着这样把你忘记";
imgUrl2="images/02.jpg";
imgtext2="迷茫";
imgUrl3="images/03.jpg";
imgtext3="恋文";
var focus_width=240;
var focus_height=200;
var text_height=18;
var swf_height = focus_height+text_height ;
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3;
var texts=imgtext1+"|"+imgtext2+"|"+imgtext3;
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 +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"> <param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&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" />');
document.write('</object>');
</script>
以上的脚本可以实现滚动图片播放器的效果,现在想通过c# .cs文件动态给动态图片进行更新
代码如下:
void Page_Load(object sender, EventArgs e)
{
StringBuilder texts = new StringBuilder();
StringBuilder paths = new StringBuilder();
XmlDocument doc = new XmlDocument();
string str = Server.MapPath("~/picture.xml");
doc.Load(str);
int i;
XmlNode node;
XmlElement pic = doc.DocumentElement;//取出pic的节点
for (i = 0; i < pic.ChildNodes.Count - 1; i++)
{
node = pic.ChildNodes[i];
texts.Append(node.ChildNodes[0].InnerText);
texts.Append("|");
paths.Append(node.ChildNodes[1].InnerText);
paths.Append("|");
}
node = pic.ChildNodes[i];
texts.Append(node.ChildNodes[0].InnerText);
paths.Append(node.ChildNodes[1].InnerText);
int focus_width = 240;
int focus_height = 200;
int text_height = 18;
int swf_height = focus_height + text_height;
StringBuilder script = new StringBuilder();
script.Append("<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 + "\"/>");
script.Append("<param name=\"allowScriptAccess\" value=\"sameDomain\"/> <param name=\"movie\" value=\"focus.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"bgcolor\" value=\"#F0F0F0\"/>");
script.Append("<param name=\"menu\" value=\"false\"/><param name=\"wmode\" value=\"opaque\"/>");
script.Append("<param name=\"FlashVars\" value=\"paths=" + paths + " &texts=" + texts + " &borderwidth=" + focus_width + " &borderheight=" + focus_height + " &textheight=" + text_height + "\"/>");
script.Append("<embed src=\"pixviewer.swf\" wmode=\"opaque\" FlashVars=\"paths=" + paths + " &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\"/>");
script.Append("</object>");
this.Response.Write(script);
}
下面是myscript单步调试时 myscript的内容,希望有些用处
<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="240" height="218" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="focus.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#F0F0F0" />
<param name="menu" value="false" />
<param name="wmode" value="opaque" />
<param name="FlashVars" value="paths=images/01.jpg|images/04.jpg|images/02.jpg|images/03.jpg|images/05.jpg &links=www.sina.com|www.sina.com|www.sina.com|www.sina.com|www.sina.com &texts=试着这样把你忘记|迷茫|恋文|毁灭|那年我们很相爱 &borderwidth=240 &borderheight=200 &textheight=18" />
<embed src="pixviewer.swf" wmode="opaque" flashvars="paths=images/01.jpg|images/04.jpg|images/02.jpg|images/03.jpg|images/05.jpg &links=www.sina.com|www.sina.com|www.sina.com|www.sina.com|www.sina.com &texts=试着这样把你忘记|迷茫|恋文|毁灭|那年我们很相爱 &borderwidth=240 &borderheight=200 &textheight=18 "
menu="false" bgcolor="#F0F0F0" quality="high" width="240 " height="200 " allowscriptaccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

运行结果不对,图片不能滚动,找了好久也没找出问题,请大家帮忙指点一下;谢谢了


搜索更多相关主题的帖子: var height images text 
2007-09-03 14:48
cyyu_ryh
Rank: 8Rank: 8
等 级:贵宾
威 望:45
帖 子:1899
专家分:176
注 册:2006-10-21
得分:0 
东西太多
去ASP.NET版去问

有事无事都密我. MSN: cyyu_ryh@hotmail.co.jp E-mail: cyyu_ryh@
2007-09-04 13:00
wodoe
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-9-4
得分:0 

代码如果没有错的话应该可以成功的


我在一个游戏站找到了一段代码
滚动图片的

不过现在好多我还是看不懂



<tr>
<td><div id="demo" style="BACKGROUND:#E0C489;overflow:hidden;color:#E0C489;width:430px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="demo1" valign="top" align="center"><table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
<td><a href="/hd/NewS2324/NewS2324.asp" target="_blank"><img src="/images/launch/gd_08.jpg" width="133" height="79" border="0"></a></td>
<td><a href="/shengnv/shengnv.asp" target="_blank"><img src="/images/launch/gd_02.jpg" width="133" height="79" border="0"></a></td>
<td><a href="/mmcenter/MMcenter.asp" target="_blank"><img src="/images/launch/gd_03.jpg" width="133" height="79" border="0"></a></td>
<td><a href="http://t.fy0.cn/admin/manage.asp" target="_blank"><img src="/images/launch/gd_04.jpg" width="133" height="79" border="0"></a></td>
<td><a href="/hd/ride/ride.asp" target="_blank"><img src="/images/launch/gd_05.jpg" width="133" height="79" border="0"></a></td>
<td><a href="/special/51/51_zb.asp" target="_blank"><img src="/images/launch/gd_06.jpg" width="133" height="79" border="0"></a></td>
<td><a href="/mmcenter/MMRecommend.asp" target="_blank"><img src="/images/launch/gd_07.jpg" width="133" height="79" border="0"></a></td>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div></td>
</tr>

[此贴子已经被作者于2007-9-5 12:51:42编辑过]

2007-09-05 12:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-167398-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.110845 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved