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

Automatic export all fla(as3) files to mp4

New Here ,
Jun 18, 2021 Jun 18, 2021

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.

1.4K
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 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++)
...
Translate
Community Expert ,
Jun 18, 2021 Jun 18, 2021

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

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

So cool JC!


Animator and content creator for Animate CC
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 19, 2021 Jun 19, 2021

Thanks a lot, Chris!

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

Thanks, 

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

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

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.

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

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.

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