5通过jsfl导入视频无需视频向导

5通过jsfl导入视频无需视频向导

本文介绍了CS5.5通过jsfl导入视频无需视频向导的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 jsfl 脚本将视频导入到我的 .fla 项目中并自动将整个内容导出为 .swf 导入视频时是否可以禁用视频向导?我不想每次都手动确认所有选项.如果有任何区别,视频采用 .flv 格式

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

推荐答案

AFAIK 你不能直接绕过 FLV 导入对话框(使用 JSFL API).

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

我尝试使用 Sikuli 脚本自动执行 FLV 导入向导.可以使用未记录的 FLfile.runCommandLine() 从 JSFL 运行该脚本.

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

我使用的是 OSX,所以我不确定下一部分是否也适用于 Windows.如果我直接运行 sikuli + 脚本:

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 将等待它运行然后继续导入有问题的 FLV.Sikuli 脚本将超时,因为永远不会出现导入 FLV 对话框.

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");

而且这似乎打开了应用程序的一个窗口并异步运行脚本,这很棒.然后我运行导入.sikuli 脚本:

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. 等待淡出(失焦)对话框
  2. 点击以获得焦点
  3. 点击在 SWF 中嵌入 FLV 并在时间轴中播放选项
  4. 等待选择正确选项的对话框
  5. 点击继续
  6. 等待下一个屏幕
  7. 点击继续
  8. 等待下一个屏幕
  9. 点击完成

此外,在我的机器上,当我打开 SikuliIDE(没有特定脚本)并最小化时,脚本总是有效.

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);

您可以在此处找到脚本的录音.在我运行 JSFL 脚本后,其余的点击由 Sikuli 处理.您还可以下载源脚本Sikuli 可执行脚本 用于我的设置,但我想它会与您不同.Sikuli 易于使用:输入命令,转到您的应用,然后按 CMD/Ctrl + Shift + 2 抓取快照并继续.

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.

如果这对您有用,那么您可能可以修改 sikuli 脚本以等待一段时间来点击序列中的下一个视频,同时 Flash 加载一个新文档.应该有其他解决方法来管理视频列表,但如果此解决方案适用于您的设置,那就有意义了.

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.

这篇关于CS5.5通过jsfl导入视频无需视频向导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 09:30