# ActionScript to JavaScript, ExternalInterface

**URL:** <https://forum.kirupa.com/t/actionscript-to-javascript-externalinterface/249530>\
**Category:** flash\
**Created:** [January 19, 2008, 7:22pm UTC](https://forum.kirupa.com/t/actionscript-to-javascript-externalinterface/249530 "2008-01-19T19:22:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnsjohansson](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jnsjohansson](https://forum.kirupa.com/u/jnsjohansson)\
**Post date:** [January 19, 2008, 7:22pm UTC](https://forum.kirupa.com/t/actionscript-to-javascript-externalinterface/249530/1 "2008-01-19T19:22:11Z")

</div>

Hi, searched for this problem but the solution does not match my case. And if it does I really don’t understand how this works. Anyhow.

First off I import the ExternalInterface within my class. After that I make the call.

```auto
ExternalInterface.call("myFunction", "Works!");

```

My script which is in the HTML looks like this.

```auto

<script language="javascript">
	function myFunction(string)
	{
		alert(string);
	}
</script>

```

Now why won’t this work? I always get some security-complaint but all the files are local. Im very very sure… 🙂
