[JSFL] Having a linkage classname according to the movie clip name
Hello,
I have some issue doing this. As I'll be doing this for some times, I wanted to try a jsfl script instead of doing this manually each time.
My library will look like this every time.

What I would like to have in the end:

What I want is simple, I just want to take the name of each movie clip and paste it into the linkage attribute.
So getting the name was pretty easy, but as it was the full path, I needed to cut it, so I used substring.
But then, despite my several attempts, I can't manage to paste the name into the linkage attribute.
It doesn't want to take my last sentence: "fl.getDocumentDOM().library.items.className = newClassName;"
Any ideas?
Here is the code:
function init()
{
fl.outputPanel.clear();
var i = fl.getDocumentDOM().library.items.length;
var lib = fl.getDocumentDOM().library;
while(i--)
{
if(fl.getDocumentDOM().library.items.itemType=="movie clip")
{
var getName = fl.getDocumentDOM().library.items.name;
newClassName = getName.substring (20, getName.length);
fl.trace(newClassName);
fl.getDocumentDOM().library.items.className = newClassName;
}
}
}
init();
