# Security Error while using External Interface

**URL:** <https://forum.kirupa.com/t/security-error-while-using-external-interface/291967>\
**Category:** flash\
**Created:** [July 8, 2009, 11:55am UTC](https://forum.kirupa.com/t/security-error-while-using-external-interface/291967 "2009-07-08T11:55:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neeraj\_b](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@neeraj\_b](https://forum.kirupa.com/u/neeraj_b)\
**Post date:** [July 8, 2009, 11:55am UTC](https://forum.kirupa.com/t/security-error-while-using-external-interface/291967/1 "2009-07-08T11:55:20Z")

</div>

Hi,

I am trying to access JS functions of the container HTML code from the swf(using External Interface). But until I add the swf in Global Security Settings it doesn’t work, even from localhost.

My question is how to ensure that this problem doesn’t come to users who access the site. If I have to build a crossdomain.xml what should be the content? I am not accessing different domains.

Thanks,  
Neeraj

AS Code:

```auto
if(ExternalInterface.available)
    {
        fileName=new String();
        fileDesc=new String();
        fileName=ExternalInterface.call("sendFileName");
        fileDesc=ExternalInterface.call("sendFileDesc");
        if(fileName!=null)
        {
            playVid(0, false)
            mcVideoControls.visible = true;
        }
        else
        {
            trace("nothing");
         
        }
    }
    else
    {
        trace("not available");
        
    }

```

JS code:

```auto

<script language="JavaScript" type="text/javascript">
var fileName="video.f4v";
var fileDesc="sample";
function sendFileName()
{
return fileName;
}
function sendFileDesc()
{
return fileDesc;
}
</script>

```
