是否可以通过file://从Flash Builder调试ExternalInterface? [英] Is it possible to debug ExternalInterface through file:// from Flash Builder?

查看:164
本文介绍了是否可以通过file://从Flash Builder调试ExternalInterface?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Adobe Flash Builder 4.5在ActionScript 3中编写的项目。它在 ExternalInterface 中注册了几个函数,以便可以从JavaScript中调用它们。

如果我访问Flash文件在服务器上,例如 http:// localhost / ,我可以成功地调用已定义的函数。如果我直接在浏览器中打开这个文件(通过 file:/// protocol),它会失败,出现如下错误:

  *** Security Sandbox Violation *** 
SecurityDomain'null'试图访问不兼容的上下文'file:/// Users / foo / src / bar / baz / bin-debug / app.swf'

一个合理的安全限制,但它有一个自相矛盾的后果:我无法调试使用 ExternalInterface ,因为Flash Builder调试器通过 file打开文档: 。



这样一个重要的功能无法正常调试,这似乎太荒谬了。我如何使用调试器与 ExternalInterface

解决方案

有两个方法来解决这个问题:通过设置 use-network = false 编译器标志
$ b


  • (请参阅: http://help.adobe.com/zh_CN/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html ctrl -f use-network)

  • 配置Flash Builder调试器以在调试时启动HTTP URL。要做到这一点,请点击:运行 - >调试配置,然后在URL或启动路径下输入(比如说)http:// localhost /


    我一般比较喜欢后者。

    I have a project written in ActionScript 3 using Adobe Flash Builder 4.5. It registers several functions in an ExternalInterface, so that they may be called from JavaScript.

    If I access the Flash document on a server, for example http://localhost/, I am able to call the defined functions successfully. If I just open the file in my browser directly (through the file:/// protocol) it will fail with an error like this:

    *** Security Sandbox Violation ***
    SecurityDomain 'null' tried to access incompatible context 'file:///Users/foo/src/bar/baz/bin-debug/app.swf'
    

    A reasonable security restriction, but it has a paradoxical consequence: I'm unable to debug the use of ExternalInterface because the Flash Builder debugger opens the document through file:.

    It seems too absurd to be true that such an important feature can't be debugged normally.

    How can I use the debugger with ExternalInterface?

    解决方案

    There are two ways to solve this:

    I generally prefer the latter.

    这篇关于是否可以通过file://从Flash Builder调试ExternalInterface?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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