Loading external swf from a different domain


/ Published in: ActionScript 3
Save to your folder(s)

by Big Spaceship


Copy this code and paste it in your HTML
  1. var l:Loader = new Loader();
  2. l.contentLoaderInfo.addEventListener(Event.COMPLETE, _onLoadComplete_handler);
  3. if(Security.sandboxType == Security.REMOTE){
  4. var context:LoaderContext = new LoaderContext();
  5. context.securityDomain = SecurityDomain.currentDomain;
  6. l.load(new URLRequest('http://domain.com/extFile.swf'), context);
  7. }else{
  8. l.load(new URLRequest('extFile.swf'));
  9. }

URL: http://www.bigspaceship.com/blog/labs/flash-files-domains-and-security-errors-oh-my/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.