# Can't get ExternalInterface.addCallback right, what am I doing wrong?

**URL:** <https://forum.kirupa.com/t/cant-get-externalinterface-addcallback-right-what-am-i-doing-wrong/254663>\
**Category:** flash\
**Created:** [March 13, 2008, 11:05pm UTC](https://forum.kirupa.com/t/cant-get-externalinterface-addcallback-right-what-am-i-doing-wrong/254663 "2008-03-13T23:05:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![audiohominis](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@audiohominis](https://forum.kirupa.com/u/audiohominis)\
**Post date:** [March 13, 2008, 11:05pm UTC](https://forum.kirupa.com/t/cant-get-externalinterface-addcallback-right-what-am-i-doing-wrong/254663/1 "2008-03-13T23:05:11Z")

</div>

'Sup, guys’n’gals?  
I looked carefully at this **[example](http://blog.deconcept.com/2005/08/16/external-interface/)** but couldn’t apply it. :puzzle:  
Could you please tell me what I’m doing wrong? I lowered my aim to a simple HTML button calling a Flash function to help you help me:

Here’s the ActionScrpt 2 code from **eitest.swf** :

```php
import flash.external.ExternalInterface;

this.createTextField("myTextField", 1, 0, 0, 200, 30);
function changeMyTextFieldText()
    {
        myTextField.text = "!!!SUCCESS!!!";        
    }
ExternalInterface.addCallback("changeMyTextFieldTextFuncRegID", null, changeMyTextFieldText);

```

-And this is the HTML/JavaScript code from **eitest.HTML** :

```auto
<script type="text/javascript" src="swfobject.js"></script>        
<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
   var so = new SWFObject("eitest.swf", "eitestID", "200", "30", "9", "#FFFFFF");
   so.write("flashcontent");   
   function callASfunction()
       {
      calleFlashMovie = document.getElementById("eitestID");
      calleFlashMovie.changeMyTextFieldTextFuncRegID();
    }    
</script>
<input type="button" id="changetext" value="Call AS Function" onClick="callASfunction();"/>

```

Also, if it’s not too much to ask, would you kindly show me a simple example with an argument:

```php
function changeMyTextFieldText(textArg)
    {
        myTextField.text = textArg;        
    }

```

Muchos gracias in advance :sad:
