Click to See Complete Forum and Search --> : Embed Slide Show


jdhellkin
06-08-2003, 06:34 PM
Ok, I have been trying to get a flash slide show to be embedded in my page, but I also really want it to validate correctly (w3). I learned that using html would not get me anywhere at all, so then I tried using javascript. However, now when I go to validate it, it questions the following: document.write ('</EMBED>'); and document.write ('</OBJECT>'); (saying that the element is not open). Is there anyway I can fix this so it validates? Thanks a lot!!

Here is what I am using:

<SCRIPT type="text/javascript">
document.write
('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write
('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
document.write
('WIDTH="580" HEIGHT="480" id="100" ALIGN="middle">');
document.write
('<PARAM NAME="movie" VALUE="100.swf">');
document.write
('<PARAM NAME="play" VALUE="false">');
document.write
('<PARAM NAME="loop" VALUE="false">');
document.write
('<PARAM NAME="quality" VALUE="best">');
document.write
('<PARAM NAME="bgcolor" VALUE="#000000">');
document.write
('<EMBED img src="100.swf" play="false" loop="false" quality="best" bgcolor="#000000" WIDTH="580" HEIGHT="480" NAME="100" ALIGN="middle"');
document.write
('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write
('</EMBED>');
document.write
('</OBJECT>');
</SCRIPT>

pyro
06-08-2003, 07:04 PM
You are going to be better off with an invalid page, and not using javascript to write the flash in, as around 13% of users do not have javascript enabled. What I would do is validate the rest of your content, and not worry about the <embed> tags not validating...

gsb
06-08-2003, 11:07 PM
Hrer's one I used once. Maybe it will help you.


<SCRIPT LANGUAGE='JavaScript' type='text/javascript'>
function createSounds(){(o=document.createElement('DIV')).innerHTML="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0' id='stdwavs' width='1' height='1'> <param name='movie' value='stdwavs.swf'><param name='quality' value='high'><param name='bgcolor' value='#FFFFFF'><embed name='stdwavs' src='stdwavs.swf' quality='high' bgcolor='#FFFFFF' width='1' height='1' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed></object>";document.body.appendChild(o);with(o.style){position='absolute';left=top=-10;width=height=1}}
</SCRIPT>

</head>

<body bgcolor="#FFFFFF" onLoad="createSounds()">