本人最近把flash+js新浪效果的图片轮换代码改装了一下,在js代码中读取xml中的数据,然后用js传递给flash。单独运行html文件能显示图片并且可以轮换。但如果通过iis运行这个文件就不行了,哪位高手帮忙解决一下。
toppicxml.xml内容如下<?xml version="1.0" encoding="utf-8"?>
<Root>
<Item>
<Href>http://www.jz123.cn/</Href>
<Title>标题1</Title>
<Imageurl>picnews/01.jpg</Imageurl>
</Item>
<Item> 
<Href>http://www.jz123.cn/</Href>
<Title>标题2</Title>
<Imageurl>picnews/02.jpg</Imageurl>
</Item>
<Item> 
<Href>http://www.jz123.cn/</Href>
<Title>标题3</Title>
<Imageurl>picnews/03.jpg</Imageurl> 
</Item>
<Item> 
<Href>http://www.jz123.cn/</Href>
<Title>标题4</Title>
<Imageurl>picnews/04.jpg</Imageurl>
</Item>
<Item> 
<Href>http://www.jz123.cn/</Href> 
<Title>标题5</Title>
<Imageurl>picnews/05.jpg</Imageurl> 
</Item>
</Root>index.htm 代码如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Copyright" content="懒人图库 http://lanren.makewing.com/" />
<meta name="description" content="学会偷懒,并懒出境界是提高工作效率最有效的方法!" />
<meta content="懒人图库" name="keywords" />
<title>懒人图库</title>
<style type="text/css">
td {font-size: 12px;}
</style>
</head><body>
<p>&nbsp;</p>
<table width="558" height="251" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="279" height="251">
<script type="text/javascript"> var focus_width=240
 var focus_height=200
 var text_height=18
 var swf_height = focus_height+text_height
 
var iIndex=0;
var objectDoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
objectDoc.load("toppicxml.xml");var objectItem=objectDoc.selectNodes("Root/Item");
function getNode(objectDoc,strPath)
{
 var returnValue="";
 var strValue=objectDoc.selectSingleNode(strPath);
 if(strValue)returnValue=strValue.text;
 return returnValue;
}
var pics=getNode(objectDoc,"Root/Item["+iIndex+"]/Imageurl"); 
var links=getNode(objectDoc,"Root/Item["+iIndex+"]/Href");
var texts=getNode(objectDoc,"Root/Item["+iIndex+"]/Title");
for(iIndex=1 ; iIndex<objectItem.length ; iIndex++)
{
pics=pics+"|"+getNode(objectDoc,"Root/Item["+iIndex+"]/Imageurl");
links=links+"|"+getNode(objectDoc,"Root/Item["+iIndex+"]/Href");
texts=texts+"|"+getNode(objectDoc,"Root/Item["+iIndex+"]/Title");

 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="picnews/focus1.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+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('</object>');
 </script> </td>
    <td width="279"></td>
  </tr>
</table></body>
</html>