
Re: Copy qualified name patch
Code:
This is convenient when you have to copy class names' to insert them into flash IDE as a linkage.
I use another approach for such task. First I organize movieclips in folders (in flash library panel).
Folders structure in library represents package structure.
Then I apply jsfl script on root folder (or not root, or just on selected items).
Script configures linkage identifiers on selected clips.
For instanse: assets\items\McFooItem becomes linked as assets.items.McFooItem
jsfl script: It can be not working, because it is a part of custom FashCS panel and might have some dependencies.
That panel (with sources) can be downloaded from
http://code.google.com/p/flashcspanel/downloads/listInstalation: copy swf to WindowSWF folder in flash CS configuration dir.
On my PC it is c:\Users\{username}\AppData\Local\Adobe\Flash CS4\en\Configuration\WindowSWF
Code:
var items = getLibrary().getSelectedItems();
for each (var item in items)
{
if (item.itemType == "folder")
continue;
var className = "";
for (var i = 0; i < item.name.length; i++)
{
var char = item.name.charAt(i);
if (isAlphanum(char))
className += char;
else if (char == "/")
className += ".";
}
var baseClass = '';
if (item.itemType != 'movie clip'
&& item.itemType != 'button'
&& item.itemType != 'bitmap'
&& item.itemType != 'font'
&& item.itemType != 'sound'
)
{
continue;
}
if (item.linkageImportForRS == true)
{
item.linkageImportForRS = false;
}
item.linkageExportForAS = true;
item.linkageExportForRS = false;
item.linkageExportInFirstFrame = true;
item.linkageClassName = className;
//trace(item.name);
//trace(className);
}
libRefreshSelection();
Code:
function libRefreshSelection()
{
var lib = getLibrary();
var items = lib.getSelectedItems();
lib.selectNone();
for each (var item in items)
{
lib.selectItem(item.name, false);
}
}
var getDocument = function()
{
return fl.getDocumentDOM();
}
var getLibrary = function()
{
return getDocument().library;
}
var getTimeline = function()
{
return getDocument().getTimeline();
}