I've been embedding my Flash movies into HTML using deconcept's swfobject.js script ever since I learned about its existence.
Anyway, I looked carefully at this example but couldn't apply it to my case. Could you please tell me what I'm doing wrong? I simplified the task to just an HTML button calling a Flash function:
Here's my ActionScript2 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);
____________________________________________________
Here's my HTML 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;
}

New Topic/Question
Reply



MultiQuote




|