PDA

View Full Version : div flash content in IE does not display



grippevogel
07-06-2010, 04:41 PM
Dear users,

I'd appreciate very much any help on the following problem:

I wrote/adapted css/js scripts to display *.swf-files in a <div>-layer. Everything works fine in FF, Opera, and Safari. IE alone doesn't want to show the <div>-content. The layer just stays blank although all sec settings should allow for this. I don't get any error msg either. What could be the reason for this?

The current javascript is this:


var swfapp = "aaa";

function setswf (swfapp)
{
var dirfol = "swf";
var swfile = dirfol + "/" + swfapp;

var swfobjbof = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='' HEIGHT='' id='daFile' ALIGN=''>";
var swfobjm01 = "<PARAM NAME=movie VALUE='" + swfile + "'>";
var swfobjm02 = "<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>";
var swfobjm03 = "<EMBED src='" + swfile + "' quality=high bgcolor=#FFFFFF WIDTH='800' HEIGHT='600' NAME='" + swfile + "' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>";
var swfobjeof = "</EMBED></OBJECT>";

var x = document.getElementById('smtrDiv');
//alert (x.id); //ok
var swfStr = swfobjbof + swfobjm01 + swfobjm02 + swfobjm03 + swfobjeof;
//alert (swfStr); //ok
if (swfapp == 0704)
{x.innerHTML = "<div id=\"cr\">The copyright of all the games found here stays with their respective owners as stated in the games.<br>All the games were found under www.physicsgames.net and flash.plasticthinking.org.<br><br><img src=\"swf/IMG_2206.jpg\" border=\"0\" width=\"600\"></div>";}
else
{x.innerHTML = swfStr;}
}

Thank you for any hint,
Grippevogel

jscheuer1
07-07-2010, 09:15 AM
You've given your object tag no width or height:



. . . h/swflash.cab#version=6,0,0,0' WIDTH='' HEIGHT='' id='daFile' ALIGN=''>";

Try it with:


. . . h/swflash.cab#version=6,0,0,0' WIDTH='800' HEIGHT='600' id='daFile' ALIGN=''>";

There could also be other problems.

You may want to consider using:

http://code.google.com/p/swfobject/

practically the industry standard in Flash tag scripting.

grippevogel
07-07-2010, 12:33 PM
Dear jscheuer1,

thank you so much. I hadn't seen the woods because of all the trees standing around there. The w/h-tags really needed to be given a value. Thanks again,

Grippevogel