Skip to main content
Participating Frequently
July 30, 2012
Question

ExternalInterface.call always returns undefined in IE8@Windows7

  • July 30, 2012
  • 1 reply
  • 810 views

Hello,

I have simple function in javascript on the page:

<script type="text/javascript">

var sound_status   = true;

function get_sound_status()

{

    //alert("sound_status = " + sound_status);

    console.info("index.html::get_sound_status() = %s", sound_status);

    return sound_status;

}  

</script>

I call it from ActionScript via ExternalInterface.call("get_sound_status") and it works perfectly everywhere except IE8@Windows7 (IE8@WinXP works fine).

It always returns undefined UNTIL(!) 'Tools->Developer Tools' window is opened. It's enough to open and close it immediately.

If uncomment alert() I see the message 'sound_status = true', but in AS I have undefined.


The code embeding the swf is

NOTE: ${stuff} is replaced with actual values while publishing:



var params = {};


params.quality = "high";


params.bgcolor = "${bgcolor}";


params.allowscriptaccess = "sameDomain";


params.allowFullScreen = "true";


params.wmode = "transparent";



var attributes = {};


attributes.id = "${application}";


attributes.name = "${application}";


attributes.align = "middle";



swfobject.embedSWF(



"${swf}.swf", "flashContent",



"${width}", "${height}",



swfVersionStr, xiSwfUrlStr,



flashvars, params, attributes);

I looked into similar posts. Most of them advise check the existance of id attribute. It's here.

Thanx in advance, any help is really appreciated.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 30, 2012

test with the following to ensure id=name:


swfobject.embedSWF(



"${swf}.swf", attributes.id,



"${width}", "${height}",



swfVersionStr, xiSwfUrlStr,



flashvars, params, attributes);