title: AS3 Using a Loader to load a file protected by htaccess
body: <p>I'm attempting to load an external SWF that's hosted on a site into a local SWF file.  The external SWF is in a password-protected directory using htaccess.</p>
  
  <p>Here is the code I'm currently trying to use:</p>
  
  <pre><code>var loaderUrlRequest:URLRequest = new URLRequest("http://www.my-website.com/externalFlashFile.swf");
  loaderUrlRequest.requestHeaders.push(new URLRequestHeader("Authorization", "Basic " + $Base64.encode("username:password")));
  loaderUrlRequest.method = URLRequestMethod.POST;
  loaderUrlRequest.data = true;
  var loader:Loader = new Loader();
  addChildAt(loader, 0);
  loader.load(loaderUrlRequest);
  </code></pre>
  
  <p>The file URL, username, password, and base64 encoding are all checked and correct.</p>
  
  <p>However, I'm getting the following errors:</p>
  
  <pre><code>Error opening URL 'http://www.my-website.com/externalFlashFile.swf'
  Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
  </code></pre>
  
  <p>Any ideas what I might be doing wrong, or if there's a better way to go about this from a purely-flash perspective?</p>
  
  <p>Thanks.</p>