安全沙箱冲突的Flash AS3 [英] Security Sandbox Violation Flash AS3

查看:374
本文介绍了安全沙箱冲突的Flash AS3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过我的Flash项目播放YouTube视频。视频播放,但我得到下面的错误,它毁了我的项目的其余部分。我找不到任何地方有这个确切的错误。我一直试图了解它告诉我,但我只是不能环绕它我的头。 错误:

I'm trying to play a Youtube video through my flash project. The video plays but I get the error below and it ruins the rest of my project. I couldn't find anywhere that had this exact error. Ive been trying to understand what it's telling me but I just cant wrap my head around it. Error:

*** Security Sandbox Violation ***
SecurityDomain 'http://s.ytimg.com/yts/swfbin/apiplayer3-vflmoXxFm.swf' 
tried to access incompatible context 'file:flashProject.swf'

这里的code我对球员:

Here's the code I have for the player:

Security.allowDomain("www.youtube.com");

var my_player:Object;

var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
my_loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);

function onLoaderInit(e:Event):void{
addChild(my_loader);
my_player = my_loader.content;
my_player.addEventListener("onReady", onPlayerReady);
} 

function onPlayerReady(e:Event):void{
my_player.setSize(600,300);
my_player.cueVideoById("76BboyrEl48",0);
my_player.x = stage.stageWidth/2 - my_player.width/2;
my_player.y = stage.stageHeight/2 - my_player.height/2;
} 

这是我最后一年的大学项目的一部分,因此,如果任何人有任何想法,编号很乐意给它一个尝试。在此先感谢:)

This is part of my Final Year college project so if anyone has any ideas Id be more than happy to give it a try. Thanks in advance :)

推荐答案

尝试,包括跨domain.xml文件像您的项目如下所示。

try including a cross-domain.xml file like the one shown below on your project.

<?xml version="1.0"?>
<cross-domain-policy>
   <site-control permitted-cross-domain-policies="all"/>
   <allow-access-from domain="*"/>
   <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

否则尝试此处添加的安全设置面板下的内容。 的http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

Otherwise try adding your content here under the security settings panel. http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

有关更多的安全沙箱是指:的http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3f.html

for more about security sandbox refer: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3f.html

这篇关于安全沙箱冲突的Flash AS3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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