# Call AS function from SWF embedded with "swfobject.embedSWF"

**URL:** https://forum.kirupa.com/t/call-as-function-from-swf-embedded-with-swfobject-embedswf/315905
**Category:** flash
**Created:** [November 7, 2010, 10:50am UTC](https://forum.kirupa.com/t/call-as-function-from-swf-embedded-with-swfobject-embedswf/315905 "2010-11-07T10:50:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flashgroove](https://avatars.discourse-cdn.com/v4/letter/f/b5e925/32.png) [@flashgroove](https://forum.kirupa.com/u/flashgroove)
#### Post date: [November 7, 2010, 10:50am UTC](https://forum.kirupa.com/t/call-as-function-from-swf-embedded-with-swfobject-embedswf/315905/1 "2010-11-07T10:50:30Z")

</div>

I am trying to call an ActionScript function from a SWF embedded using “swfobject.embedSWF”.

The SWF is also located in an iframe.

In the ActionScript code, I have used “ExternalInterface”:

```auto

import flash.external.ExternalInterface;
ExternalInterface.addCallback("jsFunction", asFunction);
function asFunction():void
{
} 

```

And in the JavaScript code, I have used “getElementById”

```auto

document.getElementById("flashFile").jsFunction();

```

But this is currently not working.

Can someone please give me some indications ?
