Embedding Sound with Flash, Part II: Playing Variations: Playing Multiple Tracks - Doc JavaScript | WebReference

Embedding Sound with Flash, Part II: Playing Variations: Playing Multiple Tracks - Doc JavaScript


Embedding Sound with Flash, Part II: Playing Variations

Playing Multiple Tracks

The Flash player supports multiple instances of the FlashSound objects. Each object is associated with a different SWF file and managed independently of other objects. The practical implication is that your users can listen to two or more sound tracks at the same time. Here are three links. Click the first one to sound a funky music. Then click the Ring Me link. The funky music continues while the link is ringing. Stop the funky music by clicking the second link.

Play the funky music

Fade and stop the funky music

Ring Me

Here is the code for the above links:

<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
<SCRIPT>
  var mySoundObj1 = new FlashSound();
  var mySoundObj2 = new FlashSound();
</SCRIPT>
</HEAD>
<BODY>
<P>&ltA HREF="javascript://"
  onclick="mySoundObj1.TGotoAndPlay('/fistycuffs',
  'start')">Play the funky music</A>
<P><A HREF="javascript://"
  onclick="mySoundObj1.TGotoAndPlay('/fistycuffs',
  'fadetostop')">Fade and stop the funky music</A>
<P><A HREF="javascript://"
  onclick="mySoundObj2.TGotoAndPlay('/ringsound',
  'start')">Ring Me</A>
<SCRIPT>
  mySoundObj1.embedSWF("funkymusic.swf");
  mySoundObj2.embedSWF("ringover.swf");
</SCRIPT>
</BODY>
</HTML>

Next: How to play multiple instances

https://www.internet.com


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: April 23, 2001
Revised: April 23, 2001

URL: https://www.webreference.com/js/column82/2.html