Recently I came upon a problem, which you guys must have already faced with is embedding a flash movie on to your site while supporting the web standards. While validating the site I got 7 validation errors and all of them was because I had embedded a Flash Movie to my site.
While searching for the fix, I came on to http://www.alistapart.com/articles/flashsatay/ whose solution really worked fine for me and I am really thankful to them. The solution is real easy and you can try for yourself following the steps mentioned below.
- First of all create a container flash file, exactly of the same height and width for the movie file you want to embed on your site. For example, if you want to embed a flash banner to your site and its width is 400px and height is 250px, your container movie’s width and height would be of 400px and 250px, respectively.Name the file c.fla. You can name it something else too; just for my convenience I am naming it c.fla
- on the first frame of the movie c.fla, write a script for calling your flash movie on to it, which will be something like the below:
where banner.swf is your flash movie that you want to embed on your site.
- Now publish your container movie which in my case will be c.swf
- Now search for your flash embedded code that will be similar to the following:
- Now we will edit this code a little so that we get our desired result. Search for the code written between the <object>…</object> tags, which will be similar to-
- Edit the code to be something like below:
- Be sure to remove the <embed> … </embed> tags and whatever is between them. Your final code should be something like the below mentioned:
- Now you are ready to publish your site. Save the file and upload it along with the container movie that you created, in this case c.swf
- Check for validation.