Hii, swf 파일을 다른 서버의 Flash 응용 프로그램에로드하려고합니다. 내가 플래시 IDE에로드하려고 CRL (+ 입력) 모든 것이 잘 작동하지만, 내가 독립적 인 SWF 파일과 SWF를 실행하거나 할 때 디버깅, 나는이 오류 받고 있어요 :Flash AS3 외부 swf를 가져올 때 보안 샌드 박스 위반이 발생했습니다.
SecurityError: Error #2121: Security sandbox violation: LoaderInfo.content: file:///C|/Users/something/Desktop/blablabla/myplayer.swf cannot access http://www.somedomain.com/blablabla/lalalala/abc.swf. This may be worked around by calling Security.allowDomain.
at flash.display::LoaderInfo/get content()
at wallplayer_fla::MainTimeline/swfLoaded()[wallplayer_fla.MainTimeline::frame1:216]
Cannot display source code at this location.
을 내 서버의 루트에 crossdomain.xml 파일이 "myplayer.swf"에서
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
을 나는이 : 정말 어떻게 해야할지 모르는
Security.allowDomain("*");
Security.allowInsecureDomain("*");
...
...
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.checkPolicyFile = true;
loaderContext.allowCodeImport = true;
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
ldr.load(new URLRequest(graySwfFilename), loaderContext);
...
...
var mcExt;
var ldr:Loader;
function swfLoaded(e:Event):void {
mcExt = MovieClip(ldr.contentLoaderInfo.content);
ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
mcExt.x = 0;
mcExt.y = 0;
addChild(mcExt);
}
... 제발 도와주세요?
와우! 고마워요! 하지만 내 컴퓨터에서만 문제가 해결됩니다. 이 플레이어를 인터넷을 통해 일부 사이트에 업로드하려고한다면 수정하지 않을 것입니다 ... 그렇지 않습니까? – hdmi3killer
myplayer.swf를 웹 사이트에 구현할 때 동일한 결과를 얻을 수 있습니까? – hdmi3killer
@ hdmi3killer swf의 로컬로드 제한에 대해 로컬입니다. 일단 서버에서 이러한 제한은 로딩에 영향을주지 않습니다. – jolyonruss