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

Automatic export all fla(as3) files to mp4

New Here ,
Jun 18, 2021 Jun 18, 2021

Copy link to clipboard

Copied

Hi,

In my project, I have multiple fla files and want to export all my files to mp4 automatically. Is there any way to export files automatically.

Views

1.0K

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

Community Expert , Jun 18, 2021 Jun 18, 2021

Hi.

 

This is script should be able to open up all FLAs within a folder, export all main timeline frames as a uncompressed .mov and then open up Adobe Media Encoder so you can convert the generated video files to .mp4.

 

JSFL:

 

function main()
{
    var uri = fl.browseForFolderURL("select", "Select the folder containing the FLAs.");
    var files = FLfile.listFolder(uri + "/*.fla", "Files.");
	var total = files.length;
	var dom, i, source;	
	
    try
    {
          for (i = 0; i < total; i++)
...

Votes

Translate

Translate
Community Expert ,
Jun 18, 2021 Jun 18, 2021

Copy link to clipboard

Copied

Animate doesn't have a native script that allows auto-export. There may be a way to write a script on the OS side to open and export FLA files in a folder perhaps. How many FLA files do you have?


Animator and content creator for Animate CC

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 ,
Jun 18, 2021 Jun 18, 2021

Copy link to clipboard

Copied

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 ,
Jun 18, 2021 Jun 18, 2021

Copy link to clipboard

Copied

Hi.

 

This is script should be able to open up all FLAs within a folder, export all main timeline frames as a uncompressed .mov and then open up Adobe Media Encoder so you can convert the generated video files to .mp4.

 

JSFL:

 

function main()
{
    var uri = fl.browseForFolderURL("select", "Select the folder containing the FLAs.");
    var files = FLfile.listFolder(uri + "/*.fla", "Files.");
	var total = files.length;
	var dom, i, source;	
	
    try
    {
          for (i = 0; i < total; i++)
          {
			  source = uri + "/" + files[i];
              fl.openDocument(source);
			  dom = fl.getDocumentDOM();
			  dom.exportVideo(source.slice(0, -4) + ".mov", true, false, true, dom.timelines[0].frameCount);
              dom.close(false);
          }
    }
    catch(error)
    {
          fl.trace(files);
          fl.trace(error);
          fl.trace("___________");
    }
}

main();

 

 

Please visit this link for more info about the exportVideo method so you can customize it according to your needs.

 

I hope this helps.

 

Regards,

JC

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 ,
Jun 18, 2021 Jun 18, 2021

Copy link to clipboard

Copied

So cool JC!


Animator and content creator for Animate CC

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 ,
Jun 19, 2021 Jun 19, 2021

Copy link to clipboard

Copied

Thanks a lot, Chris!

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
New Here ,
Jun 20, 2021 Jun 20, 2021

Copy link to clipboard

Copied

Thanks, 

But I have a new problem, the encoder does not start automaticlly.

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 ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Hi.

 

It may take some time for it to open and to load the videos indeed.

 

It's best to let it open before running the script.

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 ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

You can also set the second paramater of the exportVideo method to false, like this:

dom.exportVideo(source.slice(0, -4) + ".mov", false, false, true, dom.timelines[0].frameCount);

 

Then when all the videos .mov files are created and can you send them all at once to Adobe Media Encoder.

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
Contributor ,
Aug 03, 2021 Aug 03, 2021

Copy link to clipboard

Copied

LATEST

Very useful, thank you very much.
One question, what if I wanted the export to be TIFF sequence?


____
2D vector animator since 2000 & PhD

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