Return to Snippet

Revision: 27187
at May 27, 2010 05:13 by adrianparr

Initial Code
// Please read the full blog post from Big Spacehip to understand the issue.

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(''), context);
	l.load(new URLRequest('extFile.swf'));

Initial URL

Initial Description
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.

Initial Title
AS3 Loading SWF Files Cross-Domain

Initial Tags

Initial Language
ActionScript 3