Skip to main content
benl13565393
Inspiring
January 16, 2018
Question

JSFL - Waiting until testMovie is done

  • January 16, 2018
  • 0 replies
  • 384 views

I have a JSFL script that I'm using to extract some information from FLA files. It relies on Actionscript for this, and hence needs to "run" the FLA. Typically this is done by a human running Test Movie in Animate. However we are in the process of automating the process.

I plan on using document.testMovie to do this. This works fine.

I wanted to level up the script by being able to do multiple files and it is here that I am running into a problem.

My basic sequence for this was

fl.saveDocument(fl.getDocumentDOM(), targetFla)

document.testMovie(1)

document.close(false)

As a single file, this works, however, once I do multiple files, I find that testMovie will not complete properly. My theory is that this is because there seems to be a conflict with the next pass happening while testMovie is running which doesn't allow it to fully complete. Prior to running testMovie, I do some other file processing. My conclusion is based on seeing testMovie start and while it's running, I can see the operations start on the next file in the window and then the testMovie abruptly stops.

I am looking for a method to basically wait until testMovie is done. I've noticed that there is no promises support, so it seems like I'll have to use setTimeout or some other mechanism. Ideally it would be some cue from JSFL, however, I can also cue on file existence, as the actionscript will generate a log file.

I found this, and in some ways this problem is similar in nature.

flash - How to do I get JSFL to save trace output to a file AFTER a testMovie command? - Stack Overflow

Was curious if anyone else has encountered this and what their approaches were.

Oh another question. I did do Google search but it didn't turn anything up. What is the difference between testMovie and debugMovie?

Thanks!

This topic has been closed for replies.