Skip Navigation

University of Nebraska–Lincoln

Web Developer Network Wiki

Herein Lies the Accumulated Knowledge of Mankind

Embedding flash/movie in content area

There are a number of ways developers can embed flash movies without getting into trouble with accessibility (alternative content if users don't have flash player) or legal issue (link).

Some of us have found Geoff Stearns's SWFObject script to be extremely easy to use and solve all the problems mentioned above.

To download the script, click here


Code example:

<script type="text/javascript" src="swfobject.js"></script>
		
<div id="flashcontent">
To view this element you will need Flash Player. 
You can get it at 
<a href="http://www.adobe.com/go/getflashplayer">http://www.adobe.com/go/getflashplayer</a> 
thank you!
</div>

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

For more info, you can visit the project page. It provides additional info on how to use the script to trigger wmode for flash movie with transparency, embedding two flash movies and etc.

The script is currently being used at ncard.unl.edu