Flash & Ajax 操作 XML 实例:无刷新分页

2019-09-14 07:35:46丽君

  for (i=0;i<xmlroot.childNodes.length;i++)  
  {  
    attachMovie("tr","tr_"+i,i);                                     //生成行  
    this["tr_"+i]._x = 13;  
    this["tr_"+i]._y = 25*i+33;  
    this["tr_"+i].no = xmlroot.childNodes[i].attributes.id;         //取得一条记录的ID  
    this["tr_"+i].name = xmlroot.childNodes[i].firstChild;          //片名  
    this["tr_"+i].type = xmlroot.childNodes[i].attributes.type;     //类型  
    page = pageXml.firstChild.attributes.page;                      //获取当前页  
  }  
}  
if (!page)                                                         //初始页码为第一页 page=1;  
  setxml(page);                                                    //初始第一页内容  
presetxmlbtn.onRelease = function()  
{  
  setxml(page*1-1);                                                //向前翻页,读取内容  
}            
nextbtn.onRelease = function()  
{  
  setxml(page*1+1);                                                //向后翻页,读取内容