2

I'm working on an app that has 2 way Javascript to Flash communication. This works fine, up to a point.

The flash is embedded using swfObject with wmode = window, which it has to be for performance purposes. This, however, means I have to use the hideFlashCallback within FB.init. This is in order to handle pausing of the app when Facebook dialogs or chat windows are open.

The issue is, (in Internet Explorer ONLY), that after closing the dialog windows etc and using hideFlashCallback to show the flash again, I can no longer communicate from Javascript to the Flash.

The code I'm using for communication is:

function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
getFlashMovie("swfContainer2").sendToActionscript(value);

I've been looking into this for hours and cannot see ANY reason why this would happen. I know that in IE9 you should use document[movieName] instead of window[movieName], but this still doesnt solve the issue. As I say, all is working fine until the hideFlashCallback.

It seems that for some reason, document[movieName] cannot find the Flash object, even though it is clearly there on the page.

Any ideas as to why this might not work and how to solve it would be greatly appreciated!

Alex
  • 1,051
  • 1
  • 12
  • 26
  • Does this help? https://developers.facebook.com/blog/post/637/ – CBroe Nov 12 '12 at 14:05
  • Unfortunately no, this doesn't seem to help solve the issue. – Alex Nov 12 '12 at 15:14
  • I will continue looking into the info in this link in-depth just in case I can find a solution there! – Alex Nov 12 '12 at 15:15
  • Oddly, if I add in an alert before calling getFlashMovie("swfContainer2").sendToActionscript(value); then it works. I don't know if this is because of a time delay - using a setTimeout doesn't do the trick though, or if it's to do with setting the page focus? – Alex Nov 13 '12 at 11:57

0 Answers0