flashmovie.sendTextFromHtml is not a function
import flash.external.ExternalInterface;
import flash.events.Event;
function getTextFromJavaScript(str:String):void
{
received_ti.text = "From JavaScript: " + str;
}
ExternalInterface.addCallback("sendTextToFlash", getTextFromJavaScript);
function clickSend(event:Event):void
{
var jsArgument:String = sending_ti.text;
var result:Object = ExternalInterface.call("getTextFromFlash", jsArgument);
received_ti.text = "Returned: " + result;
}
send_button.addEventListener("click", clickSend);
function getFlashMovie(movieName)
{
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
function formSend(txt)
{
flashmovie = getFlashMovie("swf/compass");
flashmovie.sendTextFromHtml(txt);
console.log("sendTextFromHtml("+txt+")");
}
function getTextFromFlash(str)
{
console.log("getTextFromFlash(" + str+")");
return str + " received";
}
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="260" height="280" id="swf/compass" align="middle">
<param name="movie" value="swf/compass.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="transparent" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="always" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="swf/compass.swf" width="260" height="280">
<param name="movie" value="swf/compass.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="transparent" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="always" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.