Use Flash in SharePoint 2010

Post from Ryan McIntyre about how to use flash in SharePoint 2010:

The idea of using Flash inside SharePoint 2007 is well documented and I’ve even done it a few times myself. My preferred method (non-code) is to slap a Content Editor web part (CEWP) on the page, go into the HTML editor, and add my <object> code. Worked like a charm.

Not so much in 2010. You can add a CEWP to a 2010 page, you can go into the HTML editor and add your <object> code, but the page will never load the swf file. There are recommendations out there saying to change the Browser File Handling setting for the web application to Permissive from Strict, but this didn’t fix anything for me (tried in three separate environments.) What did work is the following method using a Page Viewer web part…

  1. Upload your swf file to a library in your site (I prefer Site Assets library if you’re not using publishing features)
  2. Create a HTML file locally with the content:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
        <html xmlns="" xml:lang="en" lang="en">
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Flash Page</title>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=",0,0,0" width="300" height="300" id="&lt;your swf filename here>" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="&lt;your swf filename here>.swf" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#ffffff" />
        <embed src="http://site/SiteAssets/&amp;amp;lt;your swf filename here>.swf" quality="high" bgcolor="#ffffcc" width="300" height="300" name="<Flash File Name>" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="" />

    Replace the <your swf filename here> with your filename, and changing any other params you need.

  3. Upload the .html file to your Site Assets library (or wherever you put your .swf file)
  4. To test your progress, click on the .html file in the library. If you’ve done everything right so far, a page should open in your browser which loads the Flash file (it may prompt you to show the file depending on your browser settings)
  5. Copy the URL of the .html file in it’s new location
  6. Navigate to the page where you want the Flash file to appear and go into edit mode
  7. Add a Page Viewer web part
  8. Edit the Page Viewer web part and choose the Web Page option, entering the link to your .html file in the Link text box
  9. Click OK, and ta-da!
  10. You will want to edit the web part again to set height and width, and hide or change the title, etc. But that’s up to you.

That’s the only method that worked for me. I found that the Browser File Handling setting had no impact on whether this method worked or not, so don’t worry about messing with that.

Edit: Turns out the Browser File Handling does need to be set to Permissive. At least it needs to be Permissive when you upload your HTML file. You can change it back to Strict after that if you need to. It looks like SharePoint adds the headers during file upload, not run time. So if you upload the HTML file with Strict, headers get added that prompt the user to download the file instead of just view it in the browser.