-
1. Re: Security sandbox violation on Air file
moccamaximum Jan 9, 2013 12:40 AM (in response to sivacse24rep)This article describes the problem you have run into:
In short: Change the line
_defaultLoader.load(urlRequest);
to
_defaultLoader.loadBytes(urlRequest);
Make sure to read the article, why this workaround should only be used during development, since it poses a security risk.
-
2. Re: Security sandbox violation on Air file
sivacse24rep Jan 9, 2013 12:55 AM (in response to moccamaximum)Yes i read the article. But when i use _defaultLoader.loadBytes(urlRequest); it says type conversion error. loadBytes should use the ByteArray. how to do that?
Thanks,
Siva
-
3. Re: Security sandbox violation on Air file
moccamaximum Jan 9, 2013 4:08 AM (in response to sivacse24rep)add this in your test_sandbox.fla/init
var loaderContext: LoaderContext = new LoaderContext();
loaderContext.allowLoadBytesCodeExecution = true;_defaultLoader.loaderContext = loaderContext;make sure to take care of necessary imports
a complete code example can be found here
-
4. Re: Security sandbox violation on Air file
sivacse24rep Jan 9, 2013 9:26 PM (in response to moccamaximum)Yes i dont it...but my question is how to use _defaultLoader.loadBytes(urlRequest); insted of _defaultLoader.load(urlRequest);
I have the path only : "C:/digient_casino/samp.swf" which is feed on urlRequest
but for loadBytes i cant user the urlRequest right? i need to give input as ByteArray. what i have is just the path of the swf...but for loadBytes what i need is byteArray....
how to do this? i can able to load the samp.swf using loader... there i can get the ByteArray then should i use the loadBytes again?
defaultLoader=new Loader();
_defaultLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onGameLoadComplete, false, 0, true);
var urlRequest:URLRequest=new URLRequest"C:/test/samp.swf");
_defaultLoader.load(urlRequest);
function onGameLoadComplete(e:Event)
{
_defaultLoader.removeEventListener(Event.COMPLETE, onGameLoadComplete, false);
var context:LoaderContext=new LoaderContext();
context.allowLoadBytesCodeExecution = true;
_defaultLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onGameLoadComplete);
_defaultLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addThisChild, false, 0, true);
_defaultLoader.loadBytes(e.target.bytes, context);
}
Should i load like this...it seems loading the same swf for two times?
-
5. Re: Security sandbox violation on Air file
moccamaximum Jan 10, 2013 12:25 AM (in response to sivacse24rep)Here is a class that converts external swf to a ByteArray
But at this point it might be useful to look at your original request, which was only to go into fullscreen mode, when you click a button in your loaded swf that tries to access stage properties which are owned by your root.
There would be another possibility that would spare you this whole workaround.
If you might consider to move the actual fullscreen event to test_sandbox.fla, you should be good, and don`t run into trouble at all.
Dispatch a custom event when your button is clicked in your samp.swf
Make the test_sandBox.air listen for it
and then execute your fullscreenmode on the root of your app.
Just my 2 cents.


