I have HUGE piece of Flash, the code for which is at the bottom of my page. However, it still insisted on loading before most of the content. Considering that the client's advertising banners are some of the things not loading immediately, I was expecting complaints.

Therefore, I'm writing the Flash to the page using JavaScript by calling loadFlash() onLoad of body. This in itself works fine, however I can't seem to get rid of the "click to activate" annoyance in IE using traditional methods. I suspect that this is because the object doesn't physically exist in the HTML despite the JavaScript having written it.

Is there a way to reference the dynamically-replaced content so that I can get rid of the Micro$oft IE ActiveX thingamajig?



function loadFlash(){
  flashCode  = '';
  flashCode += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="chamber_flash" align="middle" height="396" width="930">';
  flashCode += '<param name="allowScriptAccess" value="sameDomain">';
  flashCode += '<param name="allowFullScreen" value="false">';
  flashCode += '<param name="movie" value="GRACCHome_files/chamber_flash.swf">';
  flashCode += '<param name="quality" value="high">';
  flashCode += '<param name="bgcolor" value="#ffffff">';
  flashCode += '<embed src="GRACCHome_files/chamber_flash.swf" quality="high" bgcolor="#ffffff" name="chamber_flash" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="396" width="930">';
  flashCode += '</object>';
  flashContainer = document.getElementById('chamber_flash');
  flashContainer.outerHTML = flashCode;
  //swfObject = document.getElementById("chamber_flash");
  //swfObject.outerHTML = swfObject.outerHTML;
  //var t=setTimeout("new_fixFlashInIE();",5000)

function new_fixFlashInIE(){
  objects = document.getElementsByTagName("object");
  for (var i = 0; i < objects.length; i++){
    objects[i].outerHTML = objects[i].outerHTML;