Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT: So I just came across this neat little menu item that selects unused items...no JSFL required. It is hidden away in the contextual drop down in the header of the library panel. Click that drop down and click on "Select Unused Items". Flash will select all the unused library items and it will even skip over the ones with linkage names for dynamic instantiation. So it's really up to you...you can use this method or the script below.</p> <p>I can't take full credit for code you see below because I am taking some code I came across from an existing script located here:</p> <p><a href="https://code.google.com/p/fueljsfl/source/browse/trunk/%5B+FUEL+%5D+-+Better+Use+Count.jsfl?r=2" rel="nofollow">FUEL - Better Use Count</a></p> <p>The script as it exists checks to see the use count of a manually selected library item. It is very intelligent in the design that it even checks to see if the item contains a linkage name but may not necessarily be on the stage. This is to make sure you don't remove any items that may be instantiated dynamically. What I have done was I took the existing code and placed it inside of a for loop that runs the check based on the current item of the loop.</p> <pre><code>// Remove Unused Library Symbols var dom = fl.getDocumentDOM(); if (dom == null) { alert('Please open a file.'); } else { var lib = dom.library; var activeItem; var isFound; var item; var libItems = lib.items; fl.outputPanel.clear(); for ( var i = 0; i &lt; libItems.length; i++ ) { var curLibItemName = libItems[i].name; var curLibItemSelection = lib.selectItem(curLibItemName, true, true); var selectedItem = lib.getSelectedItems(); function scanTimeline(_timeline, _mainTimeline) { var timeline = _timeline; var layerCount = timeline.layerCount; while (layerCount--) { var frameCount = timeline.layers[layerCount].frameCount; while (frameCount--) { if (timeline.layers[layerCount].frames[frameCount] == undefined) { continue; } var elems = timeline.layers[layerCount].frames[frameCount].elements; var p = elems.length; while (p--) { // Check if it's an instance in the library if (elems[p].elementType == 'instance') { // Check if it's the same clip as our active check if (elems[p].libraryItem.name == activeItem.name) { found = true; var where; if(_mainTimeline == true) { where = 'Located in the main timeline.'; } else { where = 'Located in the library item: ' + item.name; } frameCount = 0; } } } } } } function scanLibrary() { var items = lib.items; for (var i = 0; i &lt; items.length; i++) { item = items[i]; if(item.itemType == 'movie clip') { scanTimeline(item.timeline, false); } } } // Safety check if (selectedItem.length == 0) { alert('Please make a selection in the library.'); } else { activeItem = selectedItem[0]; found = false; // Scan the main timeline first scanTimeline(dom.getTimeline(), true); // Scan the library scanLibrary(); if (found == false) { if (activeItem.linkageClassName != undefined) { fl.trace(curLibItemName + ' was not found on the stage, but it does have a linkage name so it may be instantiated dynamically. Use caution before deleting.'); } else { fl.trace(curLibItemName + ' was not found on the stage and will be removed.'); lib.deleteItem(curLibItemName); } } } } } </code></pre> <p>As I mentioned I can't take all the credit for this because the original developer of the script did the majority of the heavy lifting for this command. In the FUEL page that contains the original code it appears that Julian Dolce is responsible for that work. The code license for the original is The MIT License (MIT).</p> <p>You can copy the code from above into a new JSFL document and save it in your commands folder or download the jsfl file from the link below and place it in your commands folder.</p> <p><a href="http://andrewdollanimation.squarespace.com/storage/downloads/Remove%20Unused%20Symbols.jsfl" rel="nofollow">Download: Remove Unused Library Symbols.jsfl</a></p> <p>I hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload