April 9, 2001 - Fading a Flash Sound
April 9, 2001 Fading a Flash Sound Tips: April 2001
Yehuda Shiran, Ph.D.
|
- Make sure you have the Flash player. 96% of the surfing population already has it. Download.
- Include
flashsound.js
in the HEAD
section.
HEAD
section.
BODY
section.
onclick
event handler to the TGotoAndPlay()
method.
Here is an example that plays a funky music which you can fade and stop:
Here is the source code:
<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
<SCRIPT>
var mySoundObj = new FlashSound();
</SCRIPT>
</HEAD>
<BODY>
<P><A HREF="javascript://" onclick="mySoundObj.TGotoAndPlay('/fistycuffs', 'start')">Play the funky music</A>
<P><A HREF="javascript://" onclick="mySoundObj.TGotoAndPlay('/fistycuffs', 'fadetostop')">Fade and stop the funky music</A>
<SCRIPT>
mySoundObj.embedSWF("funkymusic.swf");
</SCRIPT>
</BODY>
</HTML>
Here are links you can use to download flashsound.js
and funkymusic.swf
: