[Flashjs] From Flash to Javascript...

Nagasamudram, Prasanna Kumar Prasanna.Nagasamudram at in.unisys.com
Wed Sep 19 04:29:09 PDT 2007


The following is the sample code

HTML
====
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<title>FlashSar</title>

<script type="text/javascript" src="JavaScriptFlashGateway.js"></script>

<script>

function updateStatus(message) {
	window.status = message;

}

</script>


</head>
<body bgcolor="#ffffff">
<div id="flash">
<script type="text/javascript">

    var uid = new Date().getTime();
    flashProxy = new FlashProxy(uid, 'JavaScriptFlashGateway.swf');
    var tag = new FlashTag('t2.swf', '600', '300'); 
    tag.setFlashvars('lcId='+uid);
    tag.write(document);
</script>
</div>

</body>
</html>


Action script
=============

// Set up Flash Integration
import com.macromedia.javascript.JavaScriptProxy;
var jsProxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);

ib1.onRelease=function()
{
		trace("Hello");
		jsProxy.call ("updateStatus","From flash");
}




Im trying to call a javascript function on the click on a flash button.

But I don't see the javascript function to be called.

Thanks
Prasanna

-----Original Message-----
From: Nagasamudram, Prasanna Kumar 
Sent: Wednesday, September 19, 2007 4:33 PM
To: 'flashjs at osflash.org'
Subject: From Flash to Javascript...


Hi All

I'm using Java script/Flash integration kit to communicate b/w
Javascript and flash using the
flashProxy.call("someflashmethod","params");

But 

If I do the same thing from flash to javascript I see that the
javascript function is not being called.

proxy.call("somejavascriptmethod","params");

Can you please give me some pointers ?

Thanks
Prasanna



More information about the Flashjs mailing list