Today I managed to find this error twice. It is happening in AIR applications. I had the same application in Flex and then I ported it to AIR. The error that appeared is this:
SecurityError: Error #3015: Loader.loadBytes() is not permitted to load content with executable code.
The error is saying that you’re no more allowed to load executable byte arrays.
To resolve it just use allowLoadBytesCodeExecution property of LoaderContext class like this:
var myLoaderContext:LoaderContext = new LoaderContext(); myLoaderContext.allowLoadBytesCodeExecution = true; var mySwfLoader:SWFLoader = new SWFLoader(); mySwfLoader.loaderContext = loaderContext; mySwfLoader.addEventListener(Event.COMPLETE, handleLoadComplete); mySwfLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, handleLoadFault); mySwfLoader.load(myByteArray);
This is all. Hope this helps you.
Tags: AIR, error, runtime errors, Security
This post was written by Andrei Ionescu
Views: 4619











How can I create a bytearray from a local file for loading?
Use FileReference and it can fetch the file contents in the form of ByteArray. More could be found at http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the-filereference-class-in-flash-player-10/
Example:
Oops sorry I missed the last part. The example I posted in my previous comment is not suitable for Loading. I am trying something similar. Please do let me know if you found a way. Thanks
Whew, thanks. I had the same issue. You just saved me a lot of time