Flash(AS3)读取Excel文件

var excelXml:XML;
var loader=new URLLoader();
loader.addEventListener(Event.COMPLETE,loadComplete);
loader.load(new URLRequest("data.xls"));
function loadComplete(e:Event):void {
excelXml=new XML(e.target.data);
readData(excelXml);
}
function readData(xml:XML) {
var ns=xml.namespace();
var rows=xml..ns::Row;
for each (var r in rows) {
   var cellData=r.ns::Cell.ns::Data.text();
   var str:String = "";
   for each (var d in cellData) {
    str+=d+",";
   }
   trace(str);
}
}

阅读更多
换一批

没有更多推荐了,返回首页