View Full Version : Security sandbox violation:
tarafenton
11-14-2007, 09:03 PM
Can anyone explain to me Security sandbox violation?
and how to get rid of this error?
I tried using a crossdomain.xml
I've also tried
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
var request:URLRequest = new URLRequest("http://tarafenton.com?myXML=1");
xmlLoader.load(request, context);
But I get another error
1137: Incorrect number of arguments. Expected no more than 1.
matbury
11-14-2007, 11:26 PM
Basically the swf is trying to access something that it doesn't have permission to access, either a URL, a server or the system hardware.
vdatiger
11-15-2007, 04:58 AM
your error is not related to security sandbox
xfreece
11-15-2007, 05:02 AM
This error is not a security error (as previous said). It's an simple runtime error. Itīs not something wrong with the code you printed here.
The error means that you're trying to call a method with more than 1 arg when it's only expecting 1.
bolt.PT
11-15-2007, 05:36 AM
Did you define xmlLoader as
var xmlLoader:URLLoader=new URLLoader();
?
It's just that it only accepts 1 argument, and you're trying to pass 2 arguments to it, so it gives that error.
try this online tutorial (http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm)
That explains how you should use XML in AS3 in a proper way.
As for the security error, try this (http://www.visible-form.com/blog/security-restrictions-in-the-authoring-environment/)
Hope this helped.
tarafenton
11-15-2007, 04:52 PM
Thanks to all of your responses :cool:
I've been digging for a while and I already read most of the information that you all provided.
My error I knew it was because I was trying to pass 2 arg but I got that piece of code from http://www.senocular.com/pub/kirupa/as3tips_p10.html I was trying to implement it, but I couldn't so I canned it
:eek: I'm still pulling my hair out on this one, so can any one be a little more specific??? Can anyone provide an sample code of how I can resolve this Security sandbox violation?
This is what I'm working with
System.security.allowDomain("http://www.tarafenton.com");
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
var request:URLRequest = new URLRequest("http://tarafenton.com?myXML=1");
xmlLoader.load(request);
Thank you matbury. Thank you vdatiger. Thank you xfreece. Thank you bolt.PT.
Thanks to anyone else who would like to help
dr_zeus
11-15-2007, 05:23 PM
I notice that you're referring to both http://tarafenton.com and http://www.tarafenton.com. It's important to note that Flash Player considers these as two different subdomains. Maybe if you consistantly use the same one, you'll get better results.
tarafenton
11-15-2007, 06:05 PM
I'm getting this error
1119: Access of possibly undefined property security through a
reference with static type Class.
matbury
11-16-2007, 04:24 PM
This is gonna be a tedious one to track down, and there's nobody better qulified to find it than you because you know the code well because you wrote the it!
Try to find out which variable it is - probably in a class, and maybe marked private or protected.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.