因为swf是可执行文件,所以在aodbe air中通过URLLoader加载Binary文件的方式加载一个外面的swf进内存,这时候如果不加处理直接通过Loader实例的loadBytes()方法加载内存中的这个包含这个swf的ByteArray对象,那么air会报错:

  SecurityError: Error #3015: Loader.loadBytes() is not permitted to load content with executable code.

  loadBytes方法不能加载可执行的内容。

在Adobe air中要想解决这个问题,只需要按照下面的做法来做就可以了:

  var loader:Loader = new Loader();
  var loaderContext:LoaderContext = new LoaderContext();
  loaderContext.allowLoadBytesCodeExecution = true;
  loader.loadBytes(bytes, loaderContext);

 

上面的问题只会出现在air中。一般的swf中则随便用。