邮件订阅
5ucms帮助Flash Player 7 安全策略解析
作者: 来源: 日期:2017/3/10 19:16:51 浏览量:17(滞后) 人气:LOADING...(实时) 【

5ucms帮助Flash Player 7 安全策略解析

    在Flash Player 6或以前,利用loadVariables()、loadVariablesNum()、LoadVars()、XML.load()等载入外部数据,是不可以跨Domain,即在domainA的Flash不可以载入在domainB的数据。但载入Sub Domain的数据是容许,即放在luar、luar、foo.luar的Flash都可以载入在此3个不同的Sub Domain的数据。

  Flash Player 7却带来了坏消息,它收紧了安全政策,载入Sub Domain的数据是不容许,不过这只对使用了Absolute Path的Flash有影响,例如loadVariablesNum("http://domainA/data.txt", 0),一般Web Server都可以设定短网址,例如http://domainA,如果Flash通过短网址载入,那麽载入外部数据就会受到影响。

  Flash 6版本的Flash,在Flash Player 7播放会出现警告字句,需要访客决定是否准许载入外部数据∶


图1 访客安全

  Flash 7版本的Flash,在Flash Player 7播放就索性没有警告字句,根本载入外部数据的动作已经被否决了。

  解决方法,制作一个名叫crossdomain.xml,放在外部数据的Server的root,即http://domainB/crossdomain.xml。XML文件里,有一行∶

  <allow-access-from domain="" />

  你可以自行加入容许路径,例如∶

  <allow-access-from domain="*" />

  <allow-access-from domain="luar" />

  <allow-access-from domain="luar" />

  <allow-access-from domain="*.luar" />

  通过加入crossdomain.xml,因此也带来一个好消息,Flash Player 7可以载入跨Domain的外部数据!无论是Flash 6或7版本的Flash,只要在Flash Player 7播放,domainB的Server有crossdomain.xml这文件,里面有∶

  <allow-access-from domain="*.domainA" /> 或

  <allow-access-from domain="*" /> 容许任何domain

  在domainA的Flash就可以载入它的数据。

  补充

  Flash MX 2004 Professional提供了Data Binding, Web Services组件,网络上有不少免费公开的Web Services,但是因为Flash Player 7这安全政策,根本得物而无所用,真荒谬!(除非那些Web Services网站可以加入crossdomain.xml)


无忧站长学院,建站自然无忧www.5ucms.org

本站推荐: 5ucms模板下载 5ucms插件下载 仿站联系Q3876307       [复制给好友] [打印] [关闭] [返回] [顶部]
上一篇:5ucms模版,使用Flash MX的3个小技巧
下一篇:5ucms插件,Flash课件一网打尽
本站声明:本网站所载文章等内容,目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权及其它问题,请在30日内与本网联系(Email:3876307#qq.com),我们将在第一时间删除内容。若原创内容转载请注明出处。
5ucms帮助Flash Player 7 安全策略解析的关键词:
评论信息
相关分类
本周热门
本月热门
关于我们 - 版权/免责 申明 - 建站服务 - 网站地图 - 稿件投递 - 联系我们 - 5ucms
Copyright © 2008-2015 www.5ucms.org