使用 as2 检测 Flash 中文件是否存在的最佳方法是什么?

发布于 2024-08-23 17:54:16 字数 319 浏览 5 评论 0原文

我需要检查 Flash 中 x 个视频的文件是否存在。我尝试过 LoadVars 和 MovieClipLoader。 LoadVars 可以工作,但它实际上在报告完成之前加载了整个视频。如果无法知道它已开始,我无法在完成之前将其删除。我不知道如何加载整个视频,我只是想检查它是否存在。 MovieClipLoader 有 onLoadError 和 onLoadStart,它们可以工作,因为我可以在 MovieClip 开始加载后立即卸载它并知道它在那里,如果出现加载错误我知道它不在那里。应该可以,但我需要运行 x 次来检查其他视频。最好的方法是什么?或者如果你完全知道另一种方法,那就更好了!

谢谢!

I need to check for file existence in Flash on x number of videos. I've tried LoadVars and MovieClipLoader. LoadVars works but it actually loaded the entire video before reporting its done. Without a way of knowing that its started, I can't delete it before its done. I don't what to load the entire video, i just want to check that its there. MovieClipLoader has onLoadError and onLoadStart, which works because I can unload the MovieClip right after its starts loading and know its there and if there's a load error I know it's not there. Should work, but I need to run that x number of times to check for the other videos. What would be the best way to do that? Or if you know of another method entirely, that would be even better!

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小嗲 2024-08-30 17:54:16

如果没有服务器端帮助,您已经使用的方法可能是检查文件是否存在而无需加载整个文件的理想解决方案(它将在取消之前加载几KB)。

我更倾向于使用服务器端脚本,如 asp.net 或 php。这样可以相对容易地实现文件检查。该脚本将返回 true 或 false 作为文件存在检查的结果。

此链接为您提供有关如何使用 loadvars 从 PHP 脚本获取数据的更多详细信息。您可以使用它创建执行文件检查的 php 脚本。

http://flash-creations.com/notes/servercomm_loadvars.php

Without server-side assistance, the method you are already using is probably the ideal solution to check the existence of files without loading the entire file (it will load few KB before cancelling it).

I would be more inclined to use a server-side script like asp.net or php. Checking of files could be achieved relatively easily with that. The script would return a true or false as the result of the file exists check.

This links gives you more details on how to use loadvars to get data from a PHP script. You can use it to create a php script that performs the file check.

http://flash-creations.com/notes/servercomm_loadvars.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文