One more IE gimmick on the list. The other day, I had a client who complained that in his flash movies, using the silliest browser in the world (not his words), people had to click the flash movie to activate the control. I had earlier found a method to solve this in IE 6. It was printing the flash movie code using javascript’s document.write() method. A small example is given below
<script language = 'javascript'>
document.write('<div><object width="120" height="50">');
document.write('<param name="movie" value="movie.swf">');
document.write('<embed src="movie.swf" width="120" height="50">');
document.write('</embed>');
document.write('</object></div>');
</script>
Ofcourse, this is a very basic example of what you should do. But nevertheless it is useful. Now, when we use the code it still shows an issue with it in IE7. This called for some more surfing on the internet. But finally I found a solution that gave the result that was required.
After the above code is added you can add the following code to get the IE7 activation issue solved
/* IE 7 JAVASCRIPT FIX FOR Flash control activation
SCRIPT BY JYOT VAKHARIA
jyot@blackidsolutions.com
http://www.blackidsolutions.com
*/
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++)
{
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
theObjects = document.getElementsByTagName(”embed”);
for (var i = 0; i < theObjects.length; i++)
{
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
Hope this will be helping you in your development. You can download the file below.




October 8th, 2007 at 12:31 am
Hi,
Remember, for this to work, you need to call it from an external document. You MAY NOT call it as a simple javascript. It has to be from an external javascript document.
Thanks
Jyot Vakharia