Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Stage Select - Library organize

Community Beginner ,
Jun 15, 2017 Jun 15, 2017

I'm looking for a script where you select items on the stage > Run a command script and Flash moves those items to a folder in the library, existing or new folder that is.

If anyone knows of such a script or a way to do it in Flash CC please let me know as that would be super useful.

Cheers

Frank

358
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 15, 2017 Jun 15, 2017

you can also use jsfl:

var doc = fl.getDocumentDOM();

var library = doc.library;

var selectAll = doc.selectAll();

var selectA = doc.selection;

for(var i=0;i<selectA.length;i++){

if(selectA.libraryItem){

moveToF('folder1',selectA.libraryItem.name);

}

}

function moveToF(folder,item){

if(!library.itemExists(folder)){

library.newFolder(folder);

}

library.moveToFolder(folder,item);

}

Translate
LEGEND ,
Jun 15, 2017 Jun 15, 2017

Any symbol instance on the stage is already going to be in the library somewhere. So you want a script for reorganizing the library? Why would these symbols not have been created in the correct folder to begin with?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2017 Jun 15, 2017

Thanks for the reply Clay! really appreciate it

to Answer your Question:

Sadly because I'm not that organized when making them and things just get created in the root when I'm working quickly on animation or a scene, then I have to go moving things one by one

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

Errr... why one by one? Animate supports standard ctrl and shift multi-selecting in the library perfectly well.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

I marked kglad's answer as being Correct, but you should be careful about how things are named, especially with HTML5 Canvas projects. With AS3 you can get away with library items being named the same thing, if they are in different folders. You can with Canvas too, but when you publish you'll find that same named items will only show up as one of them. So, make sure that every bitmap, sound, or symbol, has a unique name, even if they're organized into folders.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

I really hope this guy hasn't just been empowered to do something simple in a more complex, roundabout way.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2017 Jun 15, 2017
LATEST

you may be correct.  anything that requires selection on stage is going to be time-consuming for anything complex enough to justify using jsfl.

the script i posted selects everything on the main timeline.  the following would allow the user to select items and then run the script, but using that does seem of limited value:

var doc = fl.getDocumentDOM();

var library = doc.library;

//var selectAll = doc.selectAll();

var selectA = doc.selection;

for(var i=0;i<selectA.length;i++){

if(selectA.libraryItem){

moveToF('folder1',selectA.libraryItem.name);

}

}

function moveToF(folder,item){

if(!library.itemExists(folder)){

library.newFolder(folder);

}

library.moveToFolder(folder,item);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2017 Jun 15, 2017

you can also use jsfl:

var doc = fl.getDocumentDOM();

var library = doc.library;

var selectAll = doc.selectAll();

var selectA = doc.selection;

for(var i=0;i<selectA.length;i++){

if(selectA.libraryItem){

moveToF('folder1',selectA.libraryItem.name);

}

}

function moveToF(folder,item){

if(!library.itemExists(folder)){

library.newFolder(folder);

}

library.moveToFolder(folder,item);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines