Avoiding sandbox messages

You might notice that, inconsistently, you see security sandbox errors when you create things in Flash. To clarify ‘odd time’ — if I load a JPEG into a Loader I don’t see the message, but if I load a JPEG into the ScrollPane I might see the message every 4/5 tests. Note: You only see the message in the Output panel (ie: in the test environment – when you Ctrl+Enter) – the SWF works in the test environment despite the message, and there is no message outside of the test environment.

I didn’t pay it much attention, but did run across this blog post recently:

http://www.visible-form.com/blog/000085.html

Therefore, if I load a JPEG from flash-mx.com and want to avoid seeing the message, I can add the following to the code:

System.security.allowDomain(“http://www.flash-mx.com”);

Then you won’t see anything in the Output panel.

So yes, pre-blogged but worthwhile nonetheless.

5 Responses to Avoiding sandbox messages

  1. On that note, if you do this:sp.contentPath = “http://yoursite.com/image.jpg“;You should see that the image isn’t masked to the size of the ScrollPane when the sandbox violation message appears in the IDE. Scrolling still works however. Haven’t tried with allowDomain with this issue.

  2. jdehaan says:

    Give it a shot with the allowDomain and it should fix the masking thing.

  3. jaydoh says:

    I am getting syntax errors with this code as is… I even tried to copy paste it

  4. jaydoh says:

    I am getting syntax errors with this code as is… I even tried to copy paste it

  5. jdehaan says:

    The line:System.security.allowDomain(“http://www.flash-mx.com“);?Doesn’t throw any syntax errors. Are you combining it with some other code or something?