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
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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