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();

  

posted on 2013-12-26 17:36  防空洞123  阅读(803)  评论(0编辑  收藏  举报

导航