Page is a not externally linkable
- Code, Content, and Presentation
-- Flash and Shockwave
---- Problem with Flash in IE


rocknbil - 7:05 pm on Oct 13, 2009 (gmt 0)


First, and probably unrelated, you are using a "half" doctype. That is, it's not a complete doctype and the page is likely rendering in Quirks Mode, as opposed to Standards Compliance Mode. what you should be using is

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

More on doctypes [webmasterworld.com]

Get this out of the way first, it will save you **many** cross browser compatibility issues.

Second, I will say it right out - and this is just my opinion - the Flash inclusion code generated by Dreamweaver and related programs is outdated, bloated, antiquated, and bereft with problems that put you in exactly these kinds of situations. Try this. It will work (for everything but IE5, I'm told.)

1. Create a "static image" of your flash. You can do this with a screen shot, create it manually, export as an image from Flash, whatever. Just make sure it's the exact same dimensions as your Flash. For the purpose of this demo, name it "flash-placeholder.jpg".

2. Take ALL of this

<div id="vid_1" style="position:absolute; left:50px; top:21px; width:800px; height:276px;">
<script language="JavaScript" type="text/javascript">

..... bla blah blah . . . you don't need this . . .

</script>
</div>

... and replace it with this.

<div id="vid_1" style="position:absolute; left:50px; top:21px; width:800px; height:276px;">
<a href="http://www.macromedia.com/go/getflashplayer" target="new window"><img src="flash-placeholder.jpg" width="800" height="276" border="0" alt="If you see this image for more than five seconds, click here and download the Flash player"></a>
</div>

3. Go here and download swfobject.js [swfobject.googlecode.com]. Extract the zip, all you need is the file swfobject.js.

4. Upload swfobject.js in the scripts directory you have set up (wpscripts). In the head of your document, add a link to it, like

<script src="wpscripts/jsRollover.js" type="text/javascript">
<script src="wpscripts/swfobject.js" type="text/javascript">

5. Almost done! Now at the bottom of your page, immediately before the closing body tag, add the code that does the work:


<script type="text/javascript">
var myvideo = new SWFObject('monoslideshow.swf', 'slideshow-video', '800', '276', '6', '#ffffff');
myvideo.addParam("wmode", "transparent");
window.onload = function() {
if (document.getElementById('vid_1')) { myvideo.write('vid_1'); }
};
</script>
</body>
</html>

Load it up. Vavoom . . . . it will work.

I am presuming your .swf is named moonslideshow.swf, if this is not the case change only that value.

What SWFObject does is loads the alternate content FIRST, does all the browser and version detection for you, so you can dispense with the erratic behavior of WYSIWYG generated code, unbloat your document, and if the div is found, the Flash object is found, writes it to the div vid_1.

It should work, if it doesn't, post the relevant sections of your code and we'll help you debug it.


Thread source:: http://www.webmasterworld.com/flash/4005693.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com