I have a strange situation in IE where JS cannot call flash using ExternalInterface after I click update. I know the movie is loading, and the code that makes ExternalInterface.addCallback() seems to end without errors
Here is a brief description of the steps to play:
- Open IE and download the movie for the first time, ExternalInterface callback methods are available for JavaScript.
- If I remove the update, the callback methods are not available, and I get the error
Object doesn't support this property or method . - If I clear my cache and refresh the page, they will be available again.
- If I delete the update again without clearing my cache, they are not available.
- If I close the browser and open again, they will be available again.
I have come across this situation before, and I am sure that the extra delay required to load and create the swf instance is what allows ExternalInterface to configure correctly. The way I worked on this before was to add a random number to the end of the SWF url so it would never be used in the cache, but this is not a real solution.
Does anyone know how to solve this?
change
I should also mention that after updating, “ExternalInterface.available” is “true”, but “ExternalInterface.objectId” is “null”.
I tried to randomize the value of the id object and insert the name and identifier of the div container and in each case ExternalInterface.objectId remains null .
Additional Information:
I don’t see how the way I insert the movie will matter, but I thought I would include the code to be sure. My movie is not affected by the “click to activate” problem, and I do not want to use SWFObject in this case, since the flash movie is a backup if there is no HTML5 sound.
var docContainer = document.createElement('div'); docContainer.innerHTML = '<object ' + 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' + 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" ' + 'id="mp3player" ' + 'width="300" ' + 'height="500">' + '<param name="allowScriptAccess" value="always" />' + '<param name="movie" value="mp3player.swf" />' + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#ffffff" />' + '<embed ' +'src="mp3player.swf" ' + 'quality="high" ' + 'bgcolor="#ffffff" ' + 'width="300" ' + 'height="500" ' + 'swLiveConnect="true" ' + 'name="mp3player" ' + 'id="mp3player" ' + 'allowScriptAccess="always" ' + 'type="application/x-shockwave-flash" ' + 'pluginspage="http://www.adobe.com/go/getflashplayer" />' + '</object>'; document.body.appendChild(docContainer);
source share