Add to Favorites

Best Practices: Embedding Flash

What is the best way to embed a flash movie into your website? When it comes to this question there is much debate. In recent years there have been a couple methods that have been very popular. The most popular method is taken straight from the code generated by Adobe. When you publish a flash movie you are given the option to publish the html that you can then paste directly in your site. This code has been written to allow the flash movie to work seamlessly with all major browsers. Basically what they have done is jammed an embed tad within an object tag. Why? To put it simply Mozilla and Netscape both ignore the object tag because it has a little attribute labeled "codebase". Codebase was created to allow IE to automatically detect the flash version be updated when it was out of date. This method is overkill considering the same action is duplicated twice within itself. Not to mention is completly thows web standards out the door. Another method commonly used involves using javascript to detect flash version and dynamically serving up the appropriate content. This isn't the prettiest way to do it.

So What's the best option? Well it looks like you can slim down the object tag and make it play nice with all browsers.

<object type="application/x-shockwave-flash"
width="100" height="100">
<param name="movie"
value="your-movie.swf" />


Be the first to leave a comment on this post.

Leave a comment

To leave a comment, please log in / sign up