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.

  1. 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
  2. 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:
    _root.loadMovie(“banner.swf”, “0”);

    flash script

    where banner.swf is your flash movie that you want to embed on your site.

  3. Now publish your container movie which in my case will be c.swf
  4. Now search for your flash embedded code that will be similar to the following:
    <script >
    AC_FL_RunContent( ‘codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0′,’width’,’400′,’height’,’250′,’title’,’Banner’,’src’,’banner’,’quality’,’high’,’pluginspage’,’http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash’,’wmode’,’transparent’,’movie’,’images/banner’ ); //end AC code
    </script>
    <noscript>
    <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0″ width=”400″ height=”250″ title=”Banner”>
    <param value=” banner.swf” />
    <param value=”high” />
    <embed src=” banner.swf” width=”400″ height=”250″ quality=”high” pluginspage=”http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash” wmode=”transparent”></embed>
    </object>
    </noscript>
  5. 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-
    <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0″ width=”400″ height=”250″ title=”Banner”>
    <param value=” banner.swf” />
    <param value=”high” />
    <embed src=” banner.swf” width=”400″ height=”250″ quality=”high” pluginspage=”http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash” wmode=”transparent”></embed>
    </object>
  6. Edit the code to be something like below:
    <object data=”c.swf?path=movie.swf” width=”400″ height=”250″ title=”Banner”>
    <param value=”c.swf?path=movie.swf” />
    <param value=”high” />
    </object>
  7. Be sure to remove the <embed> … </embed> tags and whatever is between them. Your final code should be something like the below mentioned:
    <script >
    AC_FL_RunContent( ‘codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0′,’width’,’400′,’height’,’250′,’title’,’Banner’,’src’,’banner’,’quality’,’high’,’pluginspage’,’http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash’,’wmode’,’transparent’,’movie’,’images/banner’ ); //end AC code
    </script>
    <noscript>
    <object data=”c.swf?path=movie.swf” width=”400″ height=”250″ title=”Banner”>
    <param value=”c.swf?path=movie.swf” />
    <param value=”high” />
    </object>
    </noscript>
  8. 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
  9. Check for validation.

8 Responses to “Fix for Validation Error for Embedding Flash Movies on your Site using Dreamweaver”

  1. Notsomi says:

    I would like to exchange links with your site bikasnath.com
    Is this possible?

  2. Bikas says:

    Yes, its possible…

  3. […] First of all embed the flash movie as I have mentioned in my earlier article. See: Fix for Validation Error for Embedding Flash Movies on your Site using Dreamweaver. […]

  4. DigiTrafix says:

    Excellent – worked with embedding YouTube channel without validation errors as follows:

    * is taken from http://www.youtube.com/custom_player embed for your channel – strip out their code and wrap as above

  5. DigiTrafix says:

    Hold on – wouldn’t play in IE, so went to http://www.alistapart.com/articles/flashsatay for the “Satay Method” with this code which validates and works across IE, FF, Chrome –

  6. Hey! Do you use Twitter? I’d like to follow you if that would be okay. I’m definitely enjoying your blog and look forward to new updates.

  7. Bikas says:

    Yes I do use Twitter. My id on Twitter is bikasn

  8. aocaocpupcia says:

    “Fix for Validation Error for Embedding Flash Movies on your Site using Dreamweaver | Bikas Nath” – good text :)

Leave a Reply