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.
Comments
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.
Posted by: Richard Leggett | March 9, 2005 02:31 PM
Give it a shot with the allowDomain and it should fix the masking thing.
Posted by: jdehaan | March 9, 2005 09:54 PM
I am getting syntax errors with this code as is... I even tried to copy paste it
Posted by: jaydoh | March 28, 2005 03:45 PM
I am getting syntax errors with this code as is... I even tried to copy paste it
Posted by: jaydoh | March 28, 2005 03:45 PM
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?
Posted by: jdehaan | March 28, 2005 09:20 PM