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

Exporting graphics from the library

Engaged ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Can you export graphics in the Animate Library to a folder?  We are trying to rebuild old .swf into something HTML5 compliant.  I opened the original .fla and was the .png that made up the .fla.  It would be great if I could export them to a folder to build the new animations.

I'm entirely new to Animate.

Take care,

Susan

TOPICS
How to , Import and export , Other

Views

1.5K

Translate

Translate

Report

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

LEGEND , Jan 21, 2020 Jan 21, 2020

A while back João wrote a JSFL script for exporting audio files from an FLA. Here's an adapted version that seems to work for exporting bitmaps.

function exportLibraryImagesToFiles() {
	var doc = fl.getDocumentDOM();
	if (!doc) return;

	var selectedItems = doc.library.getSelectedItems();
	if (!selectedItems.length) return;

	var folder = fl.browseForFolderURL("Choose an output directory.");
	if (!folder) return;

	var i, t, sym, bmpName;
	var count = 0;

	for (i = 0; i < selectedItems.length; i
...

Votes

Translate

Translate
LEGEND ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

A while back João wrote a JSFL script for exporting audio files from an FLA. Here's an adapted version that seems to work for exporting bitmaps.

function exportLibraryImagesToFiles() {
	var doc = fl.getDocumentDOM();
	if (!doc) return;

	var selectedItems = doc.library.getSelectedItems();
	if (!selectedItems.length) return;

	var folder = fl.browseForFolderURL("Choose an output directory.");
	if (!folder) return;

	var i, t, sym, bmpName;
	var count = 0;

	for (i = 0; i < selectedItems.length; i++) {
		sym = selectedItems[i];
		if (sym.itemType != "bitmap") {
			continue;
		}
		bmpName = sym.name.split("/").pop();
		// strip original extension
		t = bmpName.lastIndexOf(".");
		if (t != -1 && ["jpg", "jpeg", "png", "gif", "bmp", "psd"].indexOf(bmpName.substr(t + 1).toLowerCase()) != -1) {
			bmpName = bmpName.substr(0, t);
		}
		// do the thing
		sym.exportToFile(folder + "/" + bmpName + "." + (sym.compressionType == "photo" ? "jpg" : "png"));
		count++;
	}
	alert(count + " image(s) exported.");
}

exportLibraryImagesToFiles();

Copy into a text file and save with a .jsfl extension. Double-click to export any selected library images in the currently open FLA. For extra fanciness copy the JSFL into Animate's commands folder so it shows up under the Commands menu. In Windows this is located at :

 

%LOCALAPPDATA%\Adobe\Animate CC 2018\en_US\Configuration\Commands

 

Substituting the "2018" part for your version of Animate.

Votes

Translate

Translate

Report

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 ,
Feb 14, 2024 Feb 14, 2024

Copy link to clipboard

Copied

Hi 🙂 Thank you for code! It works well with bitmaps. Any chance to have it modified to esport selected Movie clips as well? Thank you in advance!

Votes

Translate

Translate

Report

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 ,
Feb 14, 2024 Feb 14, 2024

Copy link to clipboard

Copied

@eryk_stanko 

 

check your duplicate post about this.

Votes

Translate

Translate

Report

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 ,
Feb 15, 2024 Feb 15, 2024

Copy link to clipboard

Copied

I wrote my post/topic about this issue and responded also in this topic ( that is not mine). I will check if I created 2 topics and will delete if  there  is

duplication. Sry.

Votes

Translate

Translate

Report

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 ,
Feb 15, 2024 Feb 15, 2024

Copy link to clipboard

Copied

LATEST

ok.  let's close this.

 

locked

Votes

Translate

Translate

Report

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