AS3跨域加载SWF文件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3跨域加载SWF文件相关的知识,希望对你有一定的参考价值。
From the Big Spaceship Labs website.This is a useful workaround for the following error message ...
SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
// Please read the full blog post from Big Spacehip to understand the issue. // http://www.bigspaceship.com/blog/labs/flash-files-domains-and-security-errors-oh-my/ var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(Event.COMPLETE, _onLoadComplete_handler); if(Security.sandboxType == Security.REMOTE){ var context:LoaderContext = new LoaderContext(); context.securityDomain = SecurityDomain.currentDomain; l.load(new URLRequest('http://domain.com/extFile.swf'), context); }else{ l.load(new URLRequest('extFile.swf')); }
以上是关于AS3跨域加载SWF文件的主要内容,如果未能解决你的问题,请参考以下文章
ActionScript 3 AS3加载和显示外部SWF文件