Q 我吧
最近看了一下Flash 的帮助文件,所以就想将看到的做一些笔记。
Flash Player 7 或更高版本 默认情况下是禁止从一个域提供的swf文件访问从另一个域提供的数据、对象或变量的;从不同域提供的swf 不能互相访问对方的数据、对象和变量;另外,如果通过http加载的内容不能访问通过https的内容;从一个域加载的swf文件也不能加载另一个域的数据。
要实现跨域swf文件间的数据互相访问需要在swf 文件中调用localConnection.allowDomain() 或 System.security.allowDomain() 向从特定域提供的swf文件授予访问权限
例如:a.swf (http://www.a_site.com/a.swf) b.swf(http://www.b_site.com/b.swf) a.swf 需要访问b.swf 提供的数据或对象,在a.swf 文件中添加
        System.security.allowDomain(http://www.b_site.com);
        myMovieClip.allowDomain=function(sendingDomain) {
            return (sendingDomainhttp://www.b_site.com);
         }

如果有误,望能指正。
posted on 2004-12-16 10:10  BlackAngel2bAssassin  阅读(648)  评论(0编辑  收藏  举报