<embed allowscriptaccess="never" allownetworking="internal" src="xxoo.swf" type="application/x-shockwave-flash" width="50" height="50" quality="high" wmode="transparent">
只需在标签中添加:allowscriptaccess="never" allownetworking="internal" 这两个属性就可以了。
1,AllowScriptAccess
参数:
sameDomain:仅当SWF 文件和网页位于同一域中时才允许执行外出脚本访问。这是 AVM2 内容的默认值。
never:外出脚本访问将始终失败。
always:外出脚本访问将始终成功。
AllowScriptAccess 参数可以防止从一个域中承载的 SWF 文件访问来自另一个域的 HTML 页面中的脚本。
对从另一个域承载的所有 SWF 文件使用 可以确保位于 HTML 页面中的脚本的安全性。
2,allowNetworking
参数:
all(默认值)― SWF 文件中允许使用所有网络 API。
internal― SWF 文件可能不调用浏览器导航或浏览器交互 API,但是它会调用任何其它网络 API。
none― SWF 文件可能不调用浏览器导航或浏览器交互 API,并且它无法使用任何 SWF 到 SWF 通信 API。
可以控制 SWF 文件对网络功能的访问。调用被禁止的 API 会引发 SecurityError 异常。
当 allowNetworking 设置为 "internal" 时,以下 API 被禁止:
navigateToURL()
fscommand()
ExternalInterface.call()
当 allowNetworking 设置为 "none" 时,除了上面列出的那些 API 外,还会禁止以下 API:
sendToURL()
FileReference.download()
FileReference.upload()
Loader.load()
LocalConnection.connect()
LocalConnection.send()
NetConnection.connect()
NetStream.play()
Security.loadPolicyFile()
SharedObject.getLocal()
SharedObject.getRemote()
Socket.connect()