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 Instances

When you edit a Flash file, you can choose how the sound track synchronizes with other instances of the same sound track. You can opt, for example, that the sound track will play in parallel to other instances. You can decide, on the other hand, that only one instance can play at any one moment. These options are called sync options. Flash has four different sync options: event, start, stop, and stream. You assign the type of the sync during editing. With event sync, Flash can play multiple copies of the same sound at the same time. It replicates itself while it is currently playing. This replication is often referred to as a new "instance" of the same sound. If you re-trigger an event sound while it is playing, it does not stop, rewind, and restart the sound. Instead, you get layering of multiple instances of the same sound playing at the same time.

The following link plays a scale passage when moused over. Quickly mouse the link over and over again. A new instance starts every time you mouse over the link, creating a pile up of multiple instances. Try it:

Play a Scale

Here is the code for the above link:

<HTML>
<HEAD>
  <SCRIPT SRC="flashsound.js"></SCRIPT>
  <SCRIPT>
    var mySoundObj = new FlashSound();
  </SCRIPT>
</HEAD>
<BODY>
<P><A HREF="javascript://"
  onmouseover="mySoundObj.TGotoAndPlay('/scale-event',
  'start')">Play a Scale</A>
<SCRIPT>
  mySoundObj.embedSWF("scale.swf");
</SCRIPT>
</BODY>
</HTML>

Next: How to smooth track transitions

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/3.html