jsfl读取xml,图片,并生成swf
var newdoc = fl.createDocument(); var doc = fl.getDocumentDOM(); var URI = fl.browseForFolderURL("选择地图层文件",""); var configXMLpath = URI+"/config.xml"; var xml = XML(FLfile.read(configXMLpath)); for each(var item in xml.item) { doc.importFile(URI+"/"+item.@file,true); } for(i = 0;i<lib.items.length;i++) { var item = lib.items[i]; item.linkageExportForAs = true; var fileName = item.name.substring(0,item.name.indexOf('.')); item.linkageIdentifer = "map"+fileName; item.linkageExportInFirstFrame = true; if(item.itemType = 'bitmap') { item.compressionType = 'photo'; item.useImportJPEGQulity = true; } } lib.selectAll(); lib.updateItem(); lib.selectNone(); fl.saveDocument(doc,URI+"map.fla"); var doc = fl.openDocument(URI+"map.fla"); doc.publish(); doc.close();