Posted By

dx0ne on 03/26/10


Tagged

as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

b121417
dine
socialflasher


Loading external swf from a different domain


 / Published in: ActionScript 3
 

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

by Big Spaceship

  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. }

Report this snippet  

You need to login to post a comment.