Someone asked many times in the Flash embedded question forum how to use it, why can't pass the verification, what to do if you need to pass the verification, etc.
There were also a lot of misunderstandings during the discussion, so I just posted a single post to summarize what I knew. If I didn’t want to see my long-winded words, just jumped to the end and read the conclusion.
1. Traditional methods
codebase="/pub/shockwave/cabs/flash/
#version=7,0,0,0"
width="550" height="400" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="" quality="high" bgcolor="#ffffff" width="550"
height="400" name="mymovie" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="/go/getflashplayer" />
</object>
This method is to use object and embed tags to embed. If you are careful, you will find that many parameters of object and many properties in embed are repeated. Why do you do this? For browser compatibility, some browsers support object and some support embed, which is why both places need to be modified when modifying Flash parameters. This method is Macromedia's official method, which maximizes the functionality of Flash and has no compatibility issues. But it's not that easy to use now:
Unverified because embed tags embedded for compatibility are not compliant with W3C specifications. Of course, if you don’t care about the norms or not, it’s another matter.
Due to various reasons, Microsoft restricted the usage mode of IE's ActiveX after sp2, that is, there is a virtual box in ActiveX on the page, which requires the user to click once before the interaction is normal. Flash is embedded in web pages as an ActiveX, so it will also be implicated. This problem can only be solved by embedding Flash through JS.
There is no Flash version detection. If the flash plug-in version of the browser is not enough, or your swf file cannot be displayed normally, or an ActiveX confirms installation box will pop up - this box is very scary for many users.
2. Use only the object method
The name of this method is Flash satay, which was first published in A List Apart by Drew McLellan in 2002, and was later improved several times:
data="?path="
width="400" height="300">
<param name="movie"
value="?path=" />
<img src=""
width="200" height="100" alt="" />
</object>
A holder swf is needed to load your target swf to ensure stream capabilities in IE. If you need to pass parameters through flashvars, or interact with the page's JS, it will be very troublesome.
Same as the second point above, the virtual box problem of ActiveX.
Continue to have no version detection
There are still a few user agents (such as some versions of safari and some screen readers) who do not recognize this method and have bugs.
3. Methods of embedding with JS
Using JS embedding means that each has its own embedding methods, both well embedded and poorly embedded. Some people write it directly. To be honest, this method is not very good. I feel that there are too many hack ingredients, which is a bit verified for verification, and it does not reflect any advantages of JS. I think a good JS embed script, on the basis of ensuring that Flash should have functions, should have version detection and be able to solve the accessibility problem well (that is, how users should deal with when they cannot browse Flash content or disable JS), and should be easy to reuse.
I know of the following:
SWFObject
UFO - Unobtrusive Flash Objects
Scripts provided by Macomedia (now Adobe...)[here]and[here]。
I use SWFObject more, so I will choose it to talk about some of the advantages of this method:
There is no annoying virtual box problem in IE.
Provides a complete version detection function, and if the version is not enough, other things are displayed, such as pictures or text. It is easy to use. Just load a .js file at the header of the page, then write a container in HTML, putting ordinary text or pictures in it (for displaying when Flash cannot be displayed), and finally replace the content in this element with a script to Flash. It can be verified - of course this is not the point, it is just the effect.
4. My conclusion
At this stage, embedding Flash with JS is the most perfect method, although this method is also a compromise made due to various browser problems.
But it also uses JS to provide additional benefits while ensuring Flash functionality. In addition, someone has written a very complete embedded script that can be downloaded and used in a more comprehensive way (recommended SWFObject). What reason do we have not to use it?
SWFObject The web page is in English, here is a simple usage tutorial:
Download its .js file, here:/swfobject/(If the link is invalid, it may be that the version has been updated, please use the address given above to download the latest version on the homepage)
Embed this script file in the <head> area of your HTML page: <script type="text/javascript" src=""></script>
Write a container in your HTML for Flash, such as <div>, and give it a random id, such as flashcontent. Then put your replacement content inside.
<div >
Here is the replacement content to display when Flash cannot be displayed.
</div>
Replace this with a script:
var so = new SWFObject("", "mymovie", "200", "100", "7", "#336699");
//Parameter meaning: address, Flash id (not the container id), width, height, version requirement, background color
//This is the most basic. If you want advanced settings, please read the instructions carefully.
("flashcontent");
</script>
This script can be written in HTML or in an external .js file.
OK