This is probably not related to the Google engine for Google, since everything that works in the browser is if there is no dependency on a server that you did not mention. Assuming no case ...
If you can get Flash to call JavaScript using ExternalInterface.call () but not JavaScript to call Flash back, then this is probably one or two things: your EI callback and the handler are not properly connected (in Flash), or your JavaScript does not have a SWF object handle in the browser.
You might be trying to post some kind of code, but in the meantime, something that I know works in both IE and FireFox. Firstly, the browser code:
<html> <head> <script language="JavaScript" type="text/javascript"> var swfReady = false; function callbacksInitialized() { swfReady = true; } function helloFlash() { if (swfReady) { </script> </head> <body scroll="no"> <div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="HelloMac" width="600" height="300" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="HelloMac.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> <embed src="HelloMac.swf" quality="high" bgcolor="#869ca7" width="600" height="300" name="HelloMac" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object> <br /><br /> <input type="text" id="txtMessage" value="Hello, Flash!" /><br /> <input id="btnSend" type="button" value="Send to Flash" onclick="helloFlash();" /> </div> </body> </html>
And now, the Flash code (in my case, this is Flex, so hopefully this is clear):
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()" height="300" width="600"> <mx:Script> <![CDATA[ import mx.controls.Alert; import flash.external.ExternalInterface; private function init():void { addCallbacks(); } private function addCallbacks():void { ExternalInterface.addCallback("helloFlash", this_helloFlash); ExternalInterface.call("callbacksInitialized"); } // Display a message from the host private function this_helloFlash(message:String):void { Alert.show(message); } // Send a string to the host private function helloMac():void { if (ExternalInterface.available) { ExternalInterface.call("helloMac", txtMessage.text); } } ]]> </mx:Script> <mx:VBox horizontalCenter="0" verticalCenter="0"> <mx:TextInput id="txtMessage" text="Hello, Mac!" /> <mx:Button id="btnSend" label="Send to Host" click="helloMac()" /> </mx:VBox> </mx:Application>
This example demonstrates a Flash call in JavaScript with some text, and a JavaScript call back to Flash in a similar way. Some points to pay attention to:
- Make sure you expect to trigger the Flash until Flash informs the browser that it is ready to receive calls (as indicated by my callbacksInitialized ()).
- Test to make sure that you are using the appropriate browser-specific link object (for example, the ["HelloMac"] vs. document ["HelloMac"] window).
Without knowing anymore, I assume that this is one of these two subjects, as it was my experience. Hope it helps! I will follow up on the follow-up message, if you have any.