Forum Moderators: open

Message Too Old, No Replies

Code for flash in html for Firefox proper display please

         

stevemitch2

7:09 pm on Jun 17, 2008 (gmt 0)

10+ Year Member



can anyone suggest any changes to code in an html file that shows a flash intro so that it actually displays in firefox, here is the code:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>example</title>
<link href="style.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
body {
background-color: #412615;
}
-->
</style></head>

<BODY>
<center>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="747" height="797">
<param name="movie" value="flash/example.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<!--[if !IE]> <-->
<object data="flash/main1.swf"
width="747" height="797" type="application/x-shockwave-flash">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
FAIL (the browser should render some flash content, not this).
</object>
<!--> <![endif]-->
</object></center>
</BODY>
</HTML>

Many thanks for any help
regards steve

[edited by: engine at 10:22 am (utc) on June 18, 2008]
[edit reason] examplified, no site links, thanks [/edit]

rocknbil

4:29 pm on Jun 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard stevemitch2, the first thing - you need to use the embed tag nested inside the object tag to get this to work. It is invalid HTML, but when used this way it will work in FF. A much better solution proposed below.

Second,
<!--[if !IE]> <-->

Conditional tags are only recognized by IE, so !IE does nothing at all in other browsers.

I suggest you look at SWFObject. It's a small Javascript library that allows you to load an initial image in an ordinary page element:

<div id="header"><img src="flash_screen_capture.jpg"></div>

If Javascript is enabled, it writes the Flash to that div, providing semantic HTML to search engines and avoids your whole problem. It also gets rid of the "Gray line" problem in IE.