This is not required, but nice to have:
play toggle (or play | pause ) stopCopy and paste the code below into your HTML file, then replace all values in red accordingly.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align=""> <param name=movie value="niftyplayer.swf?file=betty.mp3&as=1"> <param name=quality value=high> <param name=bgcolor value=#FFFFFF> <embed src="niftyplayer.swf?file=betty.mp3&as=1" quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object>
If you'd like to use the JS extension, include the code below in your HTML file (it usually goes inside the head
section). You may set the height and width of the Flash (in blue, above) to 0 to make it disappear -- or use CSS, alternatively.
<script type="text/javascript" language="javascript" src="niftyplayer.js"></script>
Also, you may want to check out the FlashMP3alizer script too.
Parameter | Explanation |
---|---|
file=betty.mp3
|
substitute betty.mp3 for the file you want to play |
as=1
|
this specifies whether you want the file to auto-start playing. you may ommit as if you don't want it to auto-start.
|
This script is licensed under the MIT License, which, to put it in non-legal terms, allows you to share, use and modify it. Even for commercial purposes. Check out the Wikipedia article on this license for more.
Part of the JavaScript code was pretty much copied from this website http://www.moock.org/webdesign/flash/fscommand/. They offer a great explanation of Flash/Javascript interoperation.
Version 1.7 is out: Bug-fix release. Introduces the getState()
JavaScript function.
Now with "News" section!