spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column82


Embedding Sound with Flash, Part II: Playing Variations

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

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><A 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

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2 · Create Multilingual Web Sites with Windows Unicode Fonts
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Top 10 Threats to Wireless Security · Poll: UC Uptake on the Rise · Review: Fluke AirCheck Wi-Fi Tester 1.0


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

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