title: How do I get around this security error when drawing the stage into a BitmapData?
body: <pre><code>var snapshotWidth  : Number = stage.stageWidth;
  var snapshotHeight : Number = stage.stageHeight;
  try
  {
      var snapshot : BitmapData = new BitmapData( snapshotWidth, snapshotHeight, false, 0 );
      snapshot.draw( stage );
  }
  catch( e: Error )
  {
      snapshot = null;
  }
  </code></pre>
  
  <p>This happens inside the main as, and I guarantee stage exists. I get this error:</p>
  
  <pre><code>Error #2123: Security sandbox violation:
  BitmapData.draw: http://**********/game/flashmodule/Viewer.swf?version=1393597596
  cannot access rtmpe://???????????/game/7?token=1ph72jFIDkxr-4jL&amp;status=free.
  No policy files granted access.
  </code></pre>
  
  <p>I have hidden the urls, they are different.</p>
  
  <p>I have searched the internet and tried several policy files and put them in several places, added loadPolicyFile and even allowSecure and allowInsecure domains in the stage. Also allownetworking = "all";</p>
  
  <p>Still this error occurs. I have a camera with a stream added to the stage, so its because of this, but how / where / with what exactly do I fix this? Perhaps the policy files I have tried are wrong.</p>