linkarr = new Array();//获取连接地址的数组
picarr = new Array();//获取图片地址的数组
textarr = new Array();//获取连接标题的数组
var focus_width=330;//图片的宽度
var focus_height=280;//图片的宽度
var text_height=17;//文字的高度
var pics = "";
var links = "";
var texts = ""; //pics,link,texts分别图片路径,链接地址,和链接标题
var swf_height = focus_height+text_height;//flash的高度
var defJpeg = "jpg.jpg";//背景图片,当没有图片的时侯显示
{dede:arclist type='p_w_picpath.' row='5' orderby=pubdate typeid=1}
linkarr[[field:global name=autoindex/]] = "[field:arcurl/]";
picarr[[field:global name=autoindex/]] = "[field:picname/]";
textarr[[field:global name=autoindex/]] = "[field:title/]";
{/dede:arclist}
if(picarr[i].indexOf("jpg")==-1 && picarr[i].indexOf("JPG")==-1) picarr[i] = defJpeg;
if(pics=="") pics = picarr[i];
else pics += "|"+picarr[i];
}
if(links=="") links = linkarr[i];
else links += "|"+linkarr[i];
}
if(texts=="") texts = textarr[i];
else texts += "|"+textarr[i];
}
/*
//以上for结构形成如下的结构
var pics='/pic/001.jpg|/pic/005.jpg|/pic/007.jpg';
var links='http://www.baidu.com/|[url]http://www.163.com/[/url]|[url]http://www.126.com/[/url]';
var texts='图1|图2|图3'
*/
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash.swf">');
document.write('<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 src="flash.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" 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>');
2、本地测试要假设WEB服务器,而且,图片路径只支持 网站根目录下起始路径