+2  A: 

Unless you have a really good reason to build your Flash including DOM elements manually, consider replacing the code with a single call to a framework like SWFObject that does all the "dirty work" for you.

swfobject.embedSWF("flashmovie.swf", "container", "512", "296", "9.0.0",
    "expressInstall.swf", { allowFullScreen : true });
Jørn Schou-Rode
+1, definitely what you should do. SWFObject is a lot safer, than *anything* you might try,
poke
A: 

Could this be the reason?

IE7 breaks getElementById


If that is not the case, try setting the codebase and classid attributes of the object tag object.

object.setAttribute("codebase", "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab");
object.setAttribute("classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000");
Amarghosh
The problem likely isn't the getElementById() as Firefox and Safari would choke too.
scunliffe
A: 

You can't set the name attribute of ANY element in IE by using .setAttribute('name', value);

You will need to use:

param1.name = 'movie';//works

param1.setAttribute("name", "movie");//will fail

Note: this bug was fixed in IE8 (as long as you are running in IE8 Standards Mode)

scunliffe