Created
August 30, 2012 02:08
-
-
Save zaki/3521680 to your computer and use it in GitHub Desktop.
Rename linkages in Flash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_linkage(doc){ | |
var package=prompt('Choose a package or leave it blank',''); | |
if(package==null){ | |
alert('Command cancelled by user'); | |
} | |
var library=doc.library; | |
var items=library.items; | |
var items_length=items.length; | |
for(var h = 0; h < items_length; h++){ | |
var item=items[h]; | |
if(item.itemType=='bitmap'){ | |
var class_name=item.name.substr(item.name.lastIndexOf('/')+1).toLowerCase(); | |
class_name = class_name + '.imag' | |
//sum and set it up | |
item.linkageExportForAS=true; | |
item.linkageClassName=package+class_name; | |
item.linkageBaseClass='flash.display.BitmapData'; | |
} | |
} | |
} | |
add_linkage(fl.getDocumentDOM()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment