The Web Development Blog has moved to http://www.heidicool.com/blog/. Please visit me there to read the latest entries and to update your bookmarks and RSS feeds.
April 19, 2007
Embedding Flash Objects for Internet Explorer
Last week a colleague wrote to ask why she had to push a button to see her Web site and why it was loading so slowly. I took a look at the site, and had my usual reaction. "It looks fine in Firefox, let me check Internet Explorer."
Using SWFObject to embed Adobe Flash Content
While all the instructions and files you need are available on the SWFObject Web site, I thought it might be useful to give a quick overview of the process here.
- Download SWFObject 1.5, extract the files from the zip file and place swobject.js in your Web site directory.
- In Dreamweaver or your preferred editor, open the html file that includes your Flash content.
- Replace the code you are currently using to embed your Flash file with
<img src="http://blog.case.edu/webdev/2007/04/19/active.jpg" width="180" height="300" alt="animation" /> </div>
var so = new SWFObject("http://blog.case.edu/webdev/2007/04/19/active.swf", "sotester", "180", "300", "7", "#93a530");
so.addVariable("flashVarText", "this is passed in via FlashVars for example only");
The newly created <div> is used to hold the content that will be shown to users who don't have Flash enabled in their browser, while the script information tells the browser what file to get and what parameters to implement.
- Edit this content to specify the correct paths to your image and swf files, width and height of the elements, version of Flash you are using, etc. For illustrative purposes I've kept the above example fairly simple. It's the same code I'm using to embed the animation on this page. For your purposes you may want to include additional parameters.
- Upload your files and test in Internet Explorer and your usual browser.
That's pretty much it. To learn more about the process or to customize it for your particular needs visit the SWFObject Web site.
- Activating ActiveX Controls (Microsoft Developers Network)
- Active Content Developer Center (Adobe)
- Active Content FAQs (Adobe)
- Active Content Update: Preparing your website to handle the Microsoft changes to Internet Explorer(Adobe)
- Loading Interactive Controls Externally (Microsoft Developers Network)
TrackbacksTrackback URL for this entry is: Embedding Flash Objects for Internet Explorer
Office of Marketing and Communications