I'm having trouble with IE losing my ExternalInterface callbacks on a flash app when the swf is hidden. Has anyone else had this problem? I'm using SWFObject to embed the swf. i don't think SWFObject is responsible for the error, but i thought someone here might know about this.
Here's some more detail on exactly what's happening. I have a complex Flash application which uses SWFObject for embedding SWFs and uses External Interface for communication between the flash app and the DHTML it's embedded in.
My SWF is embedded in an div tag and set the div tag visibility to false. Most of this is done in DHTML. There is an HTML link which change the div tag visibility to true which shows the flash swf, the div it's in. There is also a button in the swf which uses ExternalInterface to hide everything.
Everything works fine in Firefox. In IE, when I click on the html link, everything operates fine. however, when i click on the close button in the swf app ( which executes the same javascript as the HTML link,) the hidden swf loses all the callbacks I've defined on it through ExternalInterface.
So, when the "window" is reopened and the JS tries to initialize the flash app, I get a JS error saying object doesn't support this property or method.
Here's some sample code that reflects what I'm trying to do.
Code:
function showDiv(divName) {
var objDivStyle = eval('document.all.' + divName + '.style');
objDivStyle.visibility = 'visible';
}
function hideDiv(divName) {
var objDivStyle = eval('document.all.' + divName + '.style');
objDivStyle.visibility = 'hidden';
}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName]
}
else {
return document[movieName]
}
}
function loadCatagory(param,iName){
showDiv('flashcontent');
thisMovie("gallery").LoadSelectedCategory(param,iName);
} When i calls the loadCatagory() function which tells like this.
Help please