Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
There are many MP3 players that have already been written in Flash, such as:
flash-mp3-player.net musicplayer.sourceforge.net www.wimpyplayer.com
Each of these players has different functionality, so check their features before choosing one for your site.
This example uses a free player from flash-mp3-player.net which is embedded in the page using the SWFObject technique we met on pages 208-208. The player is told the path to the MP3 file using a parameter called mp3.
After the second <script> tag, you can see that we have created two JavaScript variables; the first called flashvars, the second called params. Even though we are not using the flashvars variable, the SWFObject script expects it before the params variable so we need it there.