Embedding Flash content into a web page seems simple and in theory, it is.
But if you're using embed/object tags alone to embed Flash content, potential issues lurk under the surface.
As Bobby van der Sluis at A List Apart explains, a simple implementation of the embed/object tags alone isn't perfect.
Fortunately, the techniques of a solid embedding method can be found in SWFObject 2, a JavaScript that is used to embed Flash content.
As per the documentation, SWFObject 2:
- Detects the Flash Player version a user has installed and determines whether to show Flash content or alternative content.
- Doesn't require vendor-specific markup.
- Implements standards and best practices.
- Can eliminate the "click-to-activate" requirements that some browsers (notably certain versions of Internet Explorer) have due to the Eolas patent.
Will replace the current official Adobe Flash Player Detection Kit in a future version of Flash.
- Download the code from Google Code.
- Place the SWFObject 2 file in a directory that is accessible by your website's web pages.
- Include the SWFObject 2 JavaScript file on the web pages that will use it. Example:
<script type="text/javascript" src="swfobject.js"></script>
- Decide whether to use the static publishing or dynamic publishing methods that SWFObject 2 offers. The documentation details the advantages of both.
Because I typically use SWFObject 2 to remove any Internet Explorer "click-to-activate" requirement and I know that the most of the visitors to my websites have JavaScript enabled, I tend to use the dynamic publishing method but your needs may make the static publishing method more appropriate.
- Follow the instructions on the SWFObject 2 documentation page to embed your Flash content in a web page using the method you've chosen.
Happy embedding!


Reader comments (0)
Log in to post a comment