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…
- Upload your swf file to a library in your site (I prefer Site Assets library if you’re not using publishing features)
- Create a HTML file locally with the content:
Replace the <your swf filename here> with your filename, and changing any other params you need.
- Upload the .html file to your Site Assets library (or wherever you put your .swf file)
- 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)
- Copy the URL of the .html file in it’s new location
- Navigate to the page where you want the Flash file to appear and go into edit mode
- Add a Page Viewer web part
- Edit the Page Viewer web part and choose the Web Page option, entering the link to your .html file in the Link text box
- Click OK, and ta-da!
- 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.