Getting flash to play after creating object in Javascript

Hi everyone, i’m not sure if this is appropriate to ask here… I don’t know much about flash but i need to take some flash movies and basically when you click various icons it loads different flash movies without reloading the page. I am not using AJAX btw. My site is in DHTML… thru Javscript I insert this html into my page, the video filename i get thru the icon filename:

<object width=“430” height=“282” type=“application/x-shockwave-flash” data=“images/vid_2.swf” style=“display: block;”><param name=“movie” value=“images/vid_2.swf”/>

<param name=“quality” value=“high”/>

<param name=“allowScriptAcess” value=“sameDomain”/>

<param name=“FlashVars” value=“playerMode=embedded”/>

</object>

If i were to put this in my page statically, it plays in IE just fine… but if i insert them via JS by using createElement, it creates the elements with the correct attributes as it is supposed to but the swf does not play. All i get is a white box and my mouse pointer has a loading icon as if its waiting for something and it never goes away.

So do any of you flash guru’s know anything about why this is or if im supposed to do something special in IE to get it to play?

this is the JS code below which works fine in FF.

var object_placeholder = document.createElement(‘object’);
object_placeholder.setAttribute(‘type’,‘application/x-shockwave-flash’);
object_placeholder.setAttribute(‘data’, ‘images/’+new_src+’.swf’);
object_placeholder.setAttribute(‘width’, ‘430’);
object_placeholder.setAttribute(‘height’,‘282’);

var param_movie = document.createElement(‘param’);
param_movie.setAttribute(‘name’, ‘movie’);
param_movie.setAttribute(‘value’, ‘images/’+new_src+’.swf’);

var param_quality = document.createElement(‘param’);
param_quality.setAttribute(‘name’, ‘quality’);
param_quality.setAttribute(‘value’, ‘high’);

var param_acess = document.createElement(‘param’);
param_acess.setAttribute(‘name’, ‘allowScriptAcess’);
param_acess.setAttribute(‘value’, ‘sameDomain’);

var param_flash = document.createElement(‘param’);
param_flash.setAttribute(‘name’, ‘FlashVars’);
param_flash.setAttribute(‘value’, ‘playerMode=embedded’);

object_placeholder.appendChild(param_movie);
object_placeholder.appendChild(param_quality);
object_placeholder.appendChild(param_acess);
object_placeholder.appendChild(param_flash);

placeholder.appendChild(object_placeholder);
object_placeholder.style.display = ‘block’;