'Sup, guys’n’gals?
I looked carefully at this example 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:
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:
<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:
function changeMyTextFieldText(textArg)
{
myTextField.text = textArg;
}
Muchos gracias in advance :sad: