The three different LoaderContext domain types


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



Copy this code and paste it in your HTML
  1. // child SWF uses parent domain definitions
  2. // if defined there, otherwise its own
  3. var childDefinitions:LoaderContext = new LoaderContext();
  4. childDefinitions.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
  5.  
  6. // child SWF adds its unique definitions to
  7. // parent SWF; both SWFs share the same domain
  8. // child SWFs definitions do not overwrite parents
  9. var addedDefinitions:LoaderContext = new LoaderContext();
  10. addedDefinitions.applicationDomain = ApplicationDomain.currentDomain;
  11.  
  12. // child SWF domain is completely separate and
  13. // each SWF uses its own definitions
  14. var separateDefinitions:LoaderContext = new LoaderContext();
  15. separateDefinitions.applicationDomain = new ApplicationDomain();
  16.  
  17. // set loader context in load()
  18. myLoader.load(request, separateDefinitions);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.