Flash AS3 Security Sandbox Violation / s.ytimg.com

时间:2014-05-02 21:34:11

标签: actionscript-3 flash youtube youtube-api youtube-data-api

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

我正试图将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);    

}

1 个答案:

答案 0 :(得分:1)

尝试更改此值:

档案 - >发布设置

Sandbox_flash