Expression Web help

Join our community

Visit our Expression Web Forum

Insert flash in expression web

Expression web, unlike frontpage, does not support any point and click method of inserting flash onto a page. However a very simple solution is available using the swfobject.js method.

Make a code snippet.

It will save you much time in the future, if you make a code snippet of the following script. An example of creating a code snippet in expression web can be found here in our create a page include tutorial.

<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
  This text is replaced by the Flash movie.

<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");

Changing the script.

<div id="flashcontent">
  This text is replaced by the Flash movie.

You can replace this text with your own. An example might be a brief note of what the flash tutorial is about and something to tell the user to upgrade their flash player.

If the user has the required player the flash file will replace the text content. This method has the benefit of search engine optimization.

The main bit

var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
  • movie.swf - Change to the name of your swf file. In this case movie.swf.
  • id - The ID of your object or embed tag. Could be mymovie like the example above
  • width - Change to the width of your Flash movie.
  • height - Change to the height of your Flash movie.
  • version - The required player version for your Flash content. This can be a string in the format of 'majorVersion.minorVersion.revision'. An example would be: "6.0.65". Or you can just require the major version, such as "6".
  • background color - This is the hex value of the background color of your Flash movie. Change this to suit your own page colour scheme.

How to use this method in expression web

Make sure that you have the swfobject.js file in the root of your web. The most likely method of doing this is to import the file into expression web. Open the page you want to insert flash in and use split view. In the design area, click the mouse where you want the flash content to go...

Flash example below

Inserting flash in expression web tutorial. If you see this text, you do not have JavaScript turned on or you do not have the most up to date flash player.

... Then look in code view for corresponding part of the page in the html code. You will see a small grey highlighter, this is where you will paste the main code block. Officially, the code cannot be pasted into a <p> tag for instance but you could place the code inside a <p> tag and then remove the tag afterwards. This might help a little with the placement.

Test your page in a browser.

Inserting flash in expression web tutorial. (flash tutorial)

Original information source for the swfobject.js method.

Feed back or questions? Expression Web forums.


Microsoft MVP


Our forum feed can be found here

Reader not listed? Click here for more options

Expression Web Help RSS
Expression Web Help. Tips and Tricks and tutorials Get our feed now