Skip to main content
Known Participant
April 19, 2009
Question

Security Sandbox violation

  • April 19, 2009
  • 1 reply
  • 12580 views

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:/Users/Maddy/Desktop/flash-java(integration)/flash.swf cannot access file:///C:/Users/Maddy/Desktop/flash-java(integration)/test-page.html.

got this error when i tried to call the java script from flash using ExternalInterface.call

here is the code i used for flash


bt.addEventListener(MouseEvent.CLICK,sen);

function sen(e:MouseEvent):void{
    var param1:uint = 3;
var param2:uint = 7;
var result:uint = ExternalInterface.call("addNumbers", param1, param2);
t.text = String(result);
}

and the code used in html :


<script language="JavaScript">
// adds two numbers, and sends the result back to ActionScript
function addNumbers(num1, num2)
{
return (num1 + num2);
}
</script>

i am including the html and flash file.........plz tell me how to correct the error..........

this security error is buzzing me a lot......

This topic has been closed for replies.

1 reply

Known Participant
April 19, 2009

it works when i uploaded the files on web.........but its not working on my local machine.......why is it so........

kglad
Community Expert
Community Expert
April 19, 2009

go to the following link and allow your local file to access the internet zone:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html