从文件中运行的SWF:///而无需用户改变他们的Flash Player安全设置 [英] Running a SWF from file:/// without having the user change their Flash Player security settings

查看:151
本文介绍了从文件中运行的SWF:///而无需用户改变他们的Flash Player安全设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Flex应用程序,并网络流量的AA相当数量的,它使用的ExternalInterface做出一些JavaScript电话(SCORM),它加载XML文件,图像,视频,音频,它有一系列的模块,它可以被装载在某个时候...

I have a Flex app that does a a fair amount of network traffic, it uses ExternalInterface to make some javascript calls (for SCORM), it loads XML files, images, video, audio and it has a series of modules that it could be loading at some point...

所以,问题是 - 我们现在有其中用户需要一台机器,未连接到互联网上本地运行这内容的要求(这意味着它们不能连接到Adobe的站点,以改变它们的安全设置。)你可以想象,当用户双打的HTML页面上点击启动这件事情,他们看到一个安全警告,瑞士法郎正试图与另一个域比它的其他沟通。我们不能把它包在一个EXE或AIR应用程序,所以我除非有某种方式来调整一些模糊的安全设置,我们可以大清洗。任何想法的?

So the problem is - we now have a requirement where the user needs to run this content locally on a machine that is not connected to the internet (which means they can't connect to Adobe's site to change their security settings.) As you can imagine, when the user doubles clicks on the html page to launch this thing, they are greeted with a security warning that the swf is trying to communicate with another domain other than the one it's in. We can't wrap it in an exe or an AIR app so I unless there is some way to tweak some obscure security settings we may be hosed. Any idea's?

推荐答案

你所要做的正是通过AIR解决了这个问题。你真的应该给它一个尝试,它并不难有起色。如果你真的真的不能使用AIR(你没有说明具体原因,所以我想这只是因为你不希望有学习新系统),然后修改安全配置文件将解决这个问题。

What you are trying to do is exactly the problem solved by AIR. You should really give it a try, it's not that hard to pick up. If you really really can't use AIR (you didn't specify why, so I assume it's just because you don't want to have to learn a new system), then modifying the security config file will solve the problem.

基本上你需要做的是建立在全球FlashPlayerTrust中目录下的信任的文件。这可以由安装人员来完成(安装所有的JavaScript,SWF,HTML等文件到本地机器)。您应该创建目录,如果它不存在。每个操作系统的目录是:

Basically what you need to do is create a 'trust' file in the "Global FlashPlayerTrust" directory. This can be done by your installer (which installs all the javascript, SWF, html, etc files onto the local machine). You should create the directory if it does not exist. The directory for each OS is:

  • 在窗口 - %WINDIR%\ SYSTEM32 \ Macromed \闪存\ FlashPlayerTrust中
  • MAC - /库/ Application Support / Macromedia公司/ FlashPlayerTrust中
  • 在Linux的 - 在/ etc /土坯/ FlashPlayerTrust中

接下来,你需要创建信任文件。你可以使用任何名字,所以挑选这将是不可能与他人发生冲突的唯一名称。喜欢的东西CompanyName.cfg。这是一个文本文件,每行一个路径。你可以相信任何一个SWF的时间,或者整个目录。例如:

Next, you need to create the trust file. You can name it anything, so pick a unique name that would be unlikely to conflict with others. Something like CompanyName.cfg. It's a text file, with one path per line. You can trust either one SWF at a time, or an entire directory. Example:

C:\Program Files\MyCompany\CoolApp
C:\Program Files\MyCompany\OtherApp\Main.swf

要测试它的工作,您的Flash影片里面,你可以检查 System.security.sandboxType (动作1或2),或安全。中的sandboxType (ActionScript 3的)。它应具有的价值 localTrusted

To test that it's working, inside your flash movie you can check System.security.sandboxType (ActionScript 1 or 2), or Security.sandboxType (ActionScript 3). It should have the value of "localTrusted"

这篇关于从文件中运行的SWF:///而无需用户改变他们的Flash Player安全设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆