Facebook Flash not working in IE
I am working on an FB canvas application using Flash with 3D graphics. I have to enable my SWF with the wmode = "direct" parameter.
According to FB documentation , when using wmode = "direct", FB hides the Flash object when showing the popup / dialog (buy credits, chat, notifications, etc.), and after the popup it shows the flash again.
In Chrome and Firefox it works, but in IE , after closing the dialog, I checked the style of the flash element and saw that visibility = visible, but still the flash drive is still hidden!
I tried several approaches, all with the same result:
- Don't use "hideFlashCallback" in FB.init (let FB do it automatically)
-
Using "hideFlashCallback":
function onFlashHide(params) { if (params.state == 'opened') { hideFlash(); FB.Canvas.hideFlashElement(params.elem); } else if (params.state == 'closed') { showFlash(); FB.Canvas.showFlashElement(params.elem); } } function hideFlash() { $('#flashContent').css('visibility', 'hidden'); } function showFlash() { $('#flashContent').css('visibility', 'visible'); }
Thank!
Roei
UPDATE:
Another link to FB documentation: http://developers.facebook.com/docs/appsonfacebook/tutorial/#flash
source to share
I had the same problem with IE when calling FB.ui functions. The Facebook dialog will open but Flash will not return when you close.
I found a trick that solves this. Before calling FB functions, use javascript to set focus to another HTML element. After that, the Flash object became visible again when I finished the dialogue with Facebook.
// IE9 has a problem where the Flash object won't regain
// focus if it has focus when the FB UI is called. To fix this,
// We'll redirect focus before the call.
var lFocus = document.getElementById('focus_target');
lFocus.focus();
Hope it helps.
source to share