Man, I will pay someone to help me out with this puzzle. I’m just trying to create a transparent Flash object on a layer when the document loads. This works perfectly fine in Netscape, but in IE it gets errors. The only way I can get it in IE is with only using the embed tag (backwards??!) and then I can’t access it by name or make it transparent. Here is the function that works fine in Netscape:
[code]
function createFlashLayer (name,flashID, swf, xpos, ypos) {
var layer = document.createElement (‘div’)
var tobject = document.createElement(‘object’)
var param1 = document.createElement(‘param’)
var param2 = document.createElement(‘param’)
var param3 = document.createElement(‘param’)
var tembed = document.createElement(’embed’);
layer.setAttribute (‘id’, name);
layer.setAttribute (‘style’, ‘position:absolute; left:’+xpos+’;top:’+ypos);
tobject.setAttribute(‘classid’, ‘clsid:27CDB6E-AE6D-11cf-96B8-444553540000’);
tobject.setAttribute(‘codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0’);
tobject.setAttribute (‘id’, “something”);
tobject.setAttribute (’embed’, ’embed’);
param1.setAttribute (‘name’, ‘movie’);
param1.setAttribute(‘value’, swf);
param2.setAttribute(‘name’, ‘quality’);
param2.setAttribute (‘value’, ‘high’);
param3.setAttribute(‘name’, ‘wmode’);
param3.setAttribute (‘value’,’transparent’);
tembed.setAttribute(‘src’, swf);
tembed.setAttribute(‘width’, ‘350’);
tembed.setAttribute(‘height’, ‘300’);
tembed.setAttribute(‘quality’, ‘high’);
tembed.setAttribute(‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer/’);
tembed.setAttribute(‘type’, ‘application/x-shockwave-flash’);
tembed.setAttribute(‘wmode’, ‘transparent’);
tembed.setAttribute (‘name’, flashID);
document.body.appendChild (layer);
document.getElementById(name).appendChild(tobject);
tobject.appendChild(param1);
tobject.appendChild(param2);
tobject.appendChild(param3);
tobject.appendChild(tembed);
}
I call it this way:
[code]
onload = function () {
createFlashLayer(‘explodeLayer’, ‘explosion’, ‘explosion.swf’, 0,0);
createFlashLayer(‘cannonLayer’,’cannon’,’cannonshoot2.swf’,0,0);
}
Is this even possible!! I have been trying things for days now and have gotten so close, but still doesn’t work right in IE.