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!