<!---第一个xml-->
<?xml version="1.0" encoding="UTF-8"?>
<videos>
<videosrc>2011-5</videosrc>
<videosrc>avatar</videosrc>
<videosrc>avatar-vp6</videosrc>
<videosrc>cebbank_1</videosrc>
<videosrc>mv_1280x720</videosrc>
<videosrc>toystory3</videosrc>
<videosrc>第二课</videosrc>
<videosrc>ASP</videosrc>
<videosrc>录像_2</videosrc>
</videos>
<!---解析-->
/**
加载xml
**/
var arrays=new Array(); //集合对象
function loadXML(){
var myXMLs=new XML();
myXMLs.ignoreWhite=true;
var configFile=new File('video.xml');
myXMLs.load(configFile);
myXMLs.onLoad=function(success){
if(success){
var videos=myXMLs.firstChild.childNodes; //得到所有videosrc节点集合对象nodeValue nodeName
for(var i=0;i<videos.length;i++){
arrays.push(videos[i].firstChild.nodeValue);
}
}else{ //fail
arrays=null;
}
}
}
<!--第二个xml-->
<?xml version="1.0" encoding="UTF-8"?>
<videos>
<video>
<videosrc>2011-5</videosrc>
<videodes>2011-5 _中文</videodes>
</video>
<video>
<videosrc>avatar</videosrc>
<videodes>avatar _中文</videodes>
</video>
<video>
<videosrc>avatar-vp6</videosrc>
<videodes>avatar-vp6 _中文</videodes>
</video>
<video>
<videosrc>cebbank_1</videosrc>
<videodes>cebbank_1 _中文</videodes>
</video>
<video>
<videosrc>mv_1280x720</videosrc>
<videodes>mv_1280x720 _中文</videodes>
</video>
<video>
<videosrc>toystory3</videosrc>
<videodes>toystory3 _中文</videodes>
</video>
<video>
<videosrc>second class</videosrc>
<videodes>第二课 _中文</videodes>
</video>
<video>
<videosrc>ASP</videosrc>
<videodes>ASP _中文</videodes>
</video>
<video>
<videosrc>video2</videosrc>
<videodes>录像_2 _中文</videodes>
</video>
</videos>
<!--解析-->
function loadXMLS(){
var xmls=new XML();
xmls.ignoreWhite=true;
var file=new File('videos.xml');
xmls.load(file);
xmls.onLoad=function(isSuccess){
if(isSuccess){
var videos=xmls.firstChild.childNodes;
//videosrcs videodess
for(var i=0;i<videos.length;i++){
var vs=videos[i].childNodes;
//2010-5 //2010-中文
for(var j=0;j<1;j++){
trace("vs--"+vs[j].firstChild.nodeValue+"\t"+vs[j+1].firstChild.nodeValue);
videosrcs.push(vs[j].firstChild.nodeValue);
videodess.push(vs[j+1].firstChild.nodeValue);
}
}
}else{
videosrcs=null;
videodess=null;
}
}
}
//都在这里了,附件就不上传了,拷过去就可以了,有谁在弄Fms可以相互交流下了,fms太强大了