Hi,
I don't seem to be able to call Javascript from Flash. In my .fla I have...
Code:
import com.macromedia.javascript.JavaScriptProxy;
stop();
var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);
proxy.call("MovieLoaded");
In the Javascript I have...
Code:
<script type="text/javascript" src="FlashJavascriptGateway/source/javascript/Exception.js"></script>
<script type="text/javascript" src="FlashJavascriptGateway/source/javascript/FlashTag.js"></script>
<script type="text/javascript" src="FlashJavascriptGateway/source/javascript/FlashSerializer.js"></script>
<script type="text/javascript" src="FlashJavascriptGateway/source/javascript/FlashProxy.js"></script>
<script type="text/javascript">
var uid = new Date().getTime();
var flashProxy = new FlashProxy(uid, 'FlashJavascriptGateway/JavaScriptFlashGateway.swf');
function MovieLoaded(txt)
{
alert('loaded');
}
</script>
<script type="text/javascript">
var tag = new FlashTag('user_admin_mf01.swf', 480, 145); // last two arguments are height and width
tag.setFlashvars('lcId='+uid);
tag.write(document);
</script>
The Flash movie winks upon the proxy call when run from Flash application so it appears ot be calling out to the container but the alert box is never raised in the html page.
Any ideas? I can call Flash from Javascript.
CN.