PDA

Click to See Complete Forum and Search --> : Flash / JavaScript Integration Kit doesn't work



CaptainNeeder
12-07-2006, 07:19 AM
Hi,

I don't seem to be able to call Javascript from Flash. In my .fla I have...


import com.macromedia.javascript.JavaScriptProxy;

stop();

var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);


proxy.call("MovieLoaded");

In the Javascript I have...



<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.

CaptainNeeder
12-07-2006, 07:59 AM
It was a scripting security issue.