CS5.5 import video through jsfl without video wizard

血红的双手。 提交于 2019-12-23 04:47:09

问题


I'm trying to have a jsfl script import a video into my .fla project and export the entire thing as a .swf automatically Is it possible to disable the video wizard when importing videos? I'd hate to have to manually confirm all the options every single time. The video is in .flv format if that makes any difference


回答1:


AFAIK you can't bypass the FLV import dialog directly (using the JSFL API).

I've tried automating the FLV import wizard using a Sikuli script. The script can be run from JSFL using the undocumented FLfile.runCommandLine().

I'm using OSX so I'm not sure if this next part applies for Windows too. If I run the sikuli + the script directly:

FLfile.runCommandLine("/Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");

Flash will wait for this to run then continue importing the FLV which is a problem. The Sikuli script will timeout since the Import FLV dialog will never appear.

Still, I can run this:

FLfile.runCommandLine("open -a /Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");

And this seems to open a window of the application and runs the script asynchronously, which is great. Then I run the import. The sikuli script:

  1. waits for the faded out(out of focus) dialog
  2. clicks to get focus
  3. clicks the Embed FLV in SWF and play in timeline option
  4. waits for the dialog with the proper option selected
  5. clicks Continue
  6. waits for the next screen
  7. clicks Continue
  8. waits for the next screen
  9. clicks Finish

Also, on my machine, the script always worked when I had SikuliIDE open (with no particular script) and minimized.

The full test script to import a video looks like this:

var doc = fl.getDocumentDOM();
FLfile.runCommandLine("open -a /Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");
var path = FLfile.platformPathToURI('Users/george/Desktop/cuePointTest_1.flv');
doc.importFile(path);

You can find a recording of the script running here. After I run the JSFL script, the rest of the clicks are handled by Sikuli. You can also download the source script and the Sikuli executable script for my setup, but I imagine it will be different on yours. Sikuli is easy to use: type a command, go to your app and press CMD/Ctrl + Shift + 2 to grab a snapshot and continue.

If this does the job for your, then you can probably modify the sikuli script to wait for some time to do the clicks for the next video in the sequence, while Flash loads a new document. There should be other workarounds to manage a list of videos, but that makes sense if this solution works for your setup.



来源:https://stackoverflow.com/questions/7450387/cs5-5-import-video-through-jsfl-without-video-wizard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!