Embedding Flash

This is different than the default code that Flash provides. That typically involves the <embed> tag and is not valid XHTML. This doesn't use that, and is fully valid.

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


  1. User Avatar
    Permalink to comment#

    will this work crossbrowser?

    • User Avatar
      Permalink to comment#

      CrossBrowse is a virus…
      Its just a rip-off of chrome + virus

    • User Avatar
      Permalink to comment#

      Luigi, cross-browser means the same functionality effect on all (or majority) of browsers. For example, this one is about flash implementation on a page, so the guy basically asked if this implementation works on all browsers.

  2. User Avatar
    Permalink to comment#

    This seems very similar to the Flash Satay method from a while back.

  3. User Avatar
    Permalink to comment#

    I was taught that you should always use swfObject for flash replacement. Isn’t it almost always a better solution?

    • User Avatar
      Chris Coyier
      Permalink to comment#

      That’s what I typically use. Although it does require javascript, and theoretically users might have javascript disabled and Flash enabled.

      In either case, it’s just a good thing to know there is a valid way to embed flash without any help.

    • User Avatar
      Permalink to comment#

      Very true. swfOject is something worth mentioning though.

  4. User Avatar
    Rob Salaman
    Permalink to comment#

    How do you add a controller.

  5. User Avatar
    Permalink to comment#

    How could I embed a rotating flash movie as a background in my page? Thanks for the help.

  6. User Avatar
    Permalink to comment#

    It don’t work in IE.

  7. User Avatar
    Shami Photos

    what is the code for FLV file?

  8. User Avatar
    Permalink to comment#


  9. User Avatar
    Permalink to comment#

    thanks.. it saved my time and effort..it works for ie 8& above and on chrome/ff also

  10. User Avatar
    Permalink to comment#

    How do I make this responsive for mobile view….

    Thank you,

    • User Avatar
      Permalink to comment#

      Wrap the embed in a responsive container, it depends on the framework you’re using. Here’s an example from Zurb’s Foundation called Flex-Video

  11. User Avatar
    Permalink to comment#

    Where would the no-flash fallback image go in this code? and the flashvars for ie / webkit ?

  12. User Avatar
    Permalink to comment#

    This code is good for PC / Laptops. But it is not working with Mobile, Notebooks. For example this code will not work in SAMSUNG Notebook. (Tested).

    I was following the old code method.



    This works well in all browsers including mobile and mini devices.

    But when i use your recent code . It is not working with mobile devices.

    I do not where I am or You wrong.

    • User Avatar
      Permalink to comment#

      Hello Rajan
      My name is Catarina and I am trying to resolve the fact that the flash files do not work in OSi or Android, I discovered that if we install the Puffin Browser,and open the site in it can read this swf.
      That is what i want on my website, in which case the browser where its open the site is unable to enter, appear an image link and text informing you that you can download the new browser and open the flash sites on this browser, before enter in the swf movie.
      Something that can link with the codes flash charging if the flash player needs to be updated or even download.
      How can I do this? Do you know it?
      Thank :)

  13. User Avatar

    hello ..how can avoid images directory showing client url on web

  14. User Avatar

    Totally useless article. This tag has been generated by Flash CS 6 and with using always OBJECT tag instead EMBED such useful JS functions like TGotoLabel, TPlay, and so on has gone too.

  15. User Avatar
    Permalink to comment#

    I used the above code, Now my menu started displaying behind the flash animation. i mean the flash file over lapped it seems, any idea?

  16. User Avatar
    Permalink to comment#


  17. User Avatar

    How do you make flash fluid with css only with out having width and height on the html page?

  18. User Avatar
    Dylienna Santos

    This does not work for me .. Point blank

  19. User Avatar
    Permalink to comment#

    Works great!

Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.