What is the best way to embed a SWF file in an HTML page?
<object width="100" height="100">
<param name="movie" value="file.swf">
<embed src="file.swf" width="100" height="100">
</embed>
</object>
The best approach to embed a SWF into a HTML page is to use SWFObject.
It is a simple open-source Javascript library that is easy-to-use and standards-friendly method to embed Flash content.
It also offers Flash player version detection. If the user does not have the version of Flash required or has Javascript disabled, they will see a alternate content. You can also use this library to trigger a Flash player upgrade. Once the user has upgraded, they will be redirected back to the page.
An example from the documentation:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>SWFObject dynamic embed - step 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
A good tool to use along with this is the SWFObject HTML and Javascript generator. It basically generates the HTML and Javascript you need to embed the Flash using SWFObject. Comes with a very simple UI for you to input your parameters.
Highly Recommended and very simple to use.
I use http://wiltgen.net/objecty/, it helps to embed media content and avoid the IE "click to activate" problem.
As mentioned SWF Object is great. UFO is worth a look as well
If you are using one of those js libraries to insert Flash, I suggest adding plain object embed tag inside of <noscript/>
.
JavaScript Embedded in an HTML File. look this example here
http://java.pakcarid.com/Cpp.aspx?sub=400&ff=3157&topid=40&sls=25