Here’s a great example of bi-directional communication with Flash / Actionscript and Javascript inside an HTML form using SWFObject with my SWFFormFix patch.
http://devel.teratechnologies.net/swfformfix/extinterfaceexample.php
Unlike my previous example pages, this one includes the source code for the Flash movie (the FLA). Let me know if you like it!
« SWFObject 1.5 with Integrated SWFFormFix 1.0.0 SWFFormFix 2.0 Released! »


Hi Steve
I tried the example at [url=http://devel.teratechnologies.net/swfformfix/extinterfaceexample.php]http://devel.teratechnologies.net/swfformfix/extinterfaceexample.php[/url]
when i refresh the page i get a javascript error in IE 6 and also the click event "Send text to flash" fails in both IE 6 and IE 7
[:)] Tks Steve, i test it in .net V2 (web form) with the fla inside a wizard object and it works!!! It works even betwin posts in the same page! You Did it ou are the man!!!
I new that the problem in IE7 were the cach problem, it didnt hapen in IE6, im making use of your noCacheIE() function.
TKS a LOT [:)]
the code inside the wizard step is :
<code>
<script type="text/javascript" >
window["Flasher1"] = new Object();
</script>
<script type="text/javascript" src="swfformfix.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="x.js"></script>
<!— ****** for the flash object – Remember to allow script source acces on IIS;
—>
<div id="Flasher1" style="WIDTH: 572px; HEIGHT: 115px">
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject(noCacheIE("fileUpload_clientside.swf"), "Flasher1", "572px", "115px", "8", "");
so.addParam("wmode","Transparent");
so.addParam("quality","High");
so.addParam("play","True");
so.addParam("loop","False");
so.addParam("menu","False");
so.addParam("scale","Showall");
so.addVariable("precache", "false");
so.addVariable("uploadPage","Criar_Requisicao.aspx");
so.addVariable("allowScriptAccess","always");
so.addVariable("Cancelar","Cancelar()");
version=0
if (navigator.appVersion.indexOf("MSIE")!=-1){
temp=navigator.appVersion.split("MSIE")
version=parseFloat(temp[1])
}
if (version>=5.5){
so.addParam("wmode", "transparent");
}
so.write("Flasher1");
// ]]>
</script>
</div>
<script type="text/javascript">SWFFormFix("Flasher1");</script>
<script type="text/javascript">SWFFormFixAuto();</script>
</code>
ZeX, thanks to your sample I could make it work. thank you. steve, please add the nocache trick to the doc in your file. thanks again.
Hi,
I already use the swfformfix and still the problem still does’t solve
my code is like this
SWFFormFix(“flashGraph”);
SWFFormFixAuto();
any idea? I now in a hurry please reply me ASAP !
Thanks a Tone, really..
sorry i forget to put the code tag
<object id="flashGraph" width="750" height="400" >
<param name="movie" value="myMovie.swf" />
<param name="quality" value="high" />
<embed height="750" width="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
allowfullscreen="true" allowscriptaccess="sameDomain" quality="high" src="../Content/flash/Graph.swf" name="flashGraph">
</object>
</div>
<script type="text/javascript">
SWFFormFix("flashGraph");
</script>
<script type="text/javascript">
SWFFormFixAuto();
</script>
I currently using .net 3.5 for the FYP development, it work well in FF browser but nothing show in the IE.
Hope to hear from u soon
Sincerely
weixzero
Try putting this right above your object tag:
window["flashGraph"] = new Object();
</script>
thanks for quick reply,
I try but still blank.
The flash is successfully loaded, but the external interface fail communicate with my flash. It work well in FF.
Are the two flash objects from the exact same domain? Can you post your Actionscript code? Do you see any Javascript errors in IE?
In IE
SWFFormFix("flashGraph");
function javascript_to_flash(url)
{
thisMovie('flashGraph')['startFlashGraph'](url); return (true);
}
</script><script type="text/javascript">
function thisMovie(movieName)
{
var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName];
}
</script>
<script type="text/javascript">
function onFlashReady()
{
javascript_to_flash('../Content/XML/12302.xml')
}
</script>
In flash
function startFlashGraph(url:String)
{
var graphMain:GraphMain = new GraphMain();
graphMain.initGrapth(this,url);
}
var id = setInterval(onFlashReadyInit, 1000);
function onFlashReadyInit()
{
clearInterval(id);
ExternalInterface.call('onFlashReady');
}
I using IE 8, VS 2008 ASP.net 3.5.
No Javascript error.
Thanks in advance
Does this example work in your browser?
http://devel.teratechnologies.net/swfformfix/extinterfaceexample.php
Yes
The URL for your SWF is wrong – it needs to be the same in both places. IE looks at one and FF looks at the other.
I’m guessing you will want to replace “myMovie.swf” with “../Content/flash/Graph.swf” in your param movie tag
Yes it work, thanks a tone, You are the one. Muck Muck Muck
although now it din work in the FF….
i change the object tag from the earlier one to this one and change the movie name to this and it work
window["flashGraph"] = new Object();
<!--
<!--
SWFFormFix("flashGraph");
SWFFormFixAuto();
</code
window["flashGraph"] = new Object();
</script>
<object id="flashGraph" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="600" height="350" id="Graph" align="middle">
<param name="movie" value="../Content/flash/Graph.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="false" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="../Content/flash/Graph.swf" width="600" height="350">
<param name="movie" value="../Content/flash/Graph.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="false" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![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>
<script type="text/javascript">
SWFFormFix("flashGraph");
SWFFormFixAuto();
</script>
You’re welcome – I’m glad it’s working!
hey bro,
….. i could’nt call javascript functions by any means (ExternalInterface.call or Fscommand or getURL)….
please help me
after publishing my flash project , if i open them with browsers i couldnt get the sample alert message which i placed in the particular js function..