# Error calling javascript function using ExternalInterface.call

**URL:** <https://forum.kirupa.com/t/error-calling-javascript-function-using-externalinterface-call/250834>\
**Category:** flash\
**Created:** [February 1, 2008, 11:36pm UTC](https://forum.kirupa.com/t/error-calling-javascript-function-using-externalinterface-call/250834 "2008-02-01T23:36:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpann](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tpann](https://forum.kirupa.com/u/tpann)\
**Post date:** [February 1, 2008, 11:36pm UTC](https://forum.kirupa.com/t/error-calling-javascript-function-using-externalinterface-call/250834/1 "2008-02-01T23:36:54Z")

</div>

I’m attempting to execute Javascript code (the fromFlash() function) that’s in an .HTM file, in which is embedded my .SWF file. I’m using the following code in the .FLA file:

```php

myButton.addEventListener(MouseEvent.CLICK, runExp);
function runExp(e:MouseEvent):void {
 ExternalInterface.call("fromFlash");
}

```

When, from the .HTM file, I click myButton, I get the following error:

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller [file:///C:/\_Flash/email/email.swf cannot access file:///C:/\_Flash/email/loadFlash.htm](file:///C:/\_Flash\_learning/email/email.swf).

Any insights?

Thanks!
