Flash AS3 Security Sandbox Violation / s.ytimg.com

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Flash AS3 Security Sandbox Violation / s.ytimg.com相关的知识,希望对你有一定的参考价值。

我已经读了几天这个麻烦了,我疯了。请帮忙!

我试图将YouTube视频加载到我的投资组合中。我在Youtube上传了这个视频,它是公开的。我已经尝试了一些其他Youtube视频的代码,除了我的以外,它与它们完美配合...就像我说我要去疯了!请帮忙!!

*安全沙箱违规* SecurityDomain'http://s.ytimg.com/crossdomain.xml'试图访问不兼容的上下文'file:/// M | /Architecture/PORTFOLIO/WEB/PORTFOLIO.swf'

这是上下文中代码的代码:

import flash.display.Loader;
import flash.net.URLRequest;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import fl.controls.ProgressBar;
import fl.controls.ProgressBar;
import fl.transitions.TweenEvent;
import flash.events.Event;
import fl.controls.ProgressBar;
import flash.ui.MouseCursor;
import flash.system.Security;

pages.visible = false;
pages.fullPage.alpha = 0;
var my_images:XMLList;
var my_total:Number;

var page_no:Number = 1;
pages.pb.alpha = 0;

pages.btnBallon.visible = false;
pages.btnBallon.removeEventListener(MouseEvent.CLICK, lVid);
pages.btnBallon.buttonMode = false;

//Youtube loader

Security.allowDomain("*");
Security.allowDomain("www.youtube.com");
Security.allowDomain("youtube.com");
Security.allowDomain("s.ytimg.com");
Security.allowDomain("i1.ytimg.com");
Security.allowDomain("i.ytimg.com");
Security.allowDomain("http://s.ytimg.com/crossdomain.xml");
Security.allowDomain("popslinger.org");
Security.allowDomain("http://www.box.net/api/crossdomain.xml");

Security.loadPolicyFile("http://i.ytimg.com/crossdomain.xml");
Security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
Security.loadPolicyFile("http://s.ytimg.com/crossdomain.xml");
Security.loadPolicyFile('http://youtube.com/crossdomain.xml');
Security.loadPolicyFile("http://www.box.net/api/crossdomain.xml");



function video():void{
pages.btnBallon.visible = true;
pages.btnBallon.addEventListener(MouseEvent.CLICK, lVid);
pages.btnBallon.buttonMode = true;
}

function lVid(e:Event = null):void{

loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));

loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
}

function onInit(e:Event):void{
addChild(loader);
player = loader.content;
player.addEventListener("onReady",onPlayerReady);
}

function onPlayerReady(e:Event):void{
var pageTween:Tween = new Tween(pages.fullPage, "alpha",     Strong.easeOut,pages.fullPage.alpha, 0, 1, true);
player.setSize = (560,315);
player.x = pages.x + 120;
player.y = pages.y;
pages.visible = false;
pages.btnBallon.visible = false;
pages.btnBallon.removeEventListener(MouseEvent.CLICK, lVid);
pages.btnBallon.buttonMode = false;
/*pages.btnNext.removeEventListener(MouseEvent.CLICK, nextPage);
pages.btnNext.visible = false;
pages.btnPrev.removeEventListener(MouseEvent.CLICK, nextPage);
pages.btnPrev.visible = false;*/
player.loadVideoByUrl("www.youtube.com/embed/omcl93EYTrM",0);
//player.loadVideoById("omcl93EYTrM",0);    

}
答案

尝试更改此值:

文件 - >发布设置

以上是关于Flash AS3 Security Sandbox Violation / s.ytimg.com的主要内容,如果未能解决你的问题,请参考以下文章

AS3/Spritesheets/Starling 的 Flash 性能

AS3 Flash 中的类型强制

flash as3如何获取实例名字中的数字

AS3 Flash - 通过 ExternalInterface 渲染 html

Flash 的 GUI 框架(as3)[关闭]

flash as3.0 图片自动添加